3

I wanted to separate a section of my website using an URL segment that contains a special (but URL-safe) character like hyphen or tilde, so that some pages would like this: example.com/-/about or example.com/~/about

Is there any problem (technical or otherwise) this (using only a special character - or several - in an URL segment) may cause down the line?

Note: I moved the context to another question - this seems like a separate concern that I'm still curious about, as I've never really seen it done on a website.

  • 1
    This is not a good idea for a variety of reasons primary of which is that it does not add semantic value to the URL. Instead, use /definition/about. – closetnoc Dec 12 '16 at 19:20
  • 1
    It does seem more logical that the word definition URLs would be of the form example.com/definition/<word> (or /define/ or /def/ or simply /d/) rather than directly off the root as you suggest (example.com/<word>), then have all the site pages off the root instead. I imagine that "some" could grow into "quite a few" pages? But maybe having 1000's of /def/ URLs doesn't fit the bigger picture? I don't think /-/about is necessarily bad IMO, it just looks a bit weird. – MrWhite Dec 12 '16 at 20:58
  • Thank you - your comments made me realise this was an XY problem and I was asking the wrong thing, so I moved it to a new question. Still, out of mere curiosity, I'm wondering if this would cause any problems. – fstanis Dec 12 '16 at 21:53
1

I think you could do it without any major problems. The only things I can think of that could go wrong are:

  • If you need a directory with that name on your server, it may be difficult to create and work with. Command line programs use the dash (-) to specify flags and special arguments. They don't like working with files and directories that start with a dash. The tilde (~) often means your home directory and it may get expanded to that by your shell instead of being treated as literal.
  • That isn't a "normal" practice and some users may find that it looks odd enough that they might not use your site.
  • Those are not keywords, so there is no SEO benifit
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.