3

I'm already using - as a separator in my URLs, for some reasons I need to add a second one.

According to RFC 3986 I can use ., _ and ~. I also have seen some sites using + as a separator. I'm wondering which one to use, I read many articles about pro/cons for each separator and I can't decide.

  • /salty-recipes
  • /salty+spicy-recipes
  • /salty_spicy-recipes
  • /salty~spicy-recipes
  • 3
    What is wrong with /salty-spicy-recipes? I don't see any need for multiple separators here. – Stephen Ostermiller Oct 2 at 0:59
  • 3
    Maybe if we knew the "some reasons" why you think you need a "second separator" it would help answer your question? Maybe a different approach altogether is required? Maybe another path segment? The three suggestions above just look odd. – DocRoot Oct 2 at 1:11
  • 2
    @StephenOstermiller @DocRoot I need it for searching, the example above is a bit simplified. In this URL /term1_term2-term3_term4 I'm aiming to search term1 and term2 in category 1, and term3 and term4 in category 2. I can use URL parameters, but I need a clean url, I'm also aware of duplicate content. – Raftel Oct 2 at 1:34
  • When you use underscores, Google will think the terms are related. – closetnoc Oct 2 at 3:18
  • You could also consider a slash (/) or a period (.) as a separator there. – Stephen Ostermiller Oct 2 at 11:00
1

Personally, If I needed to use an operator other than a hyphen '-' I would use an underscore because it seems cleaner and is often used for variables when writing code.

In your comments you said you're needing the extra operator to perform a search using the words in the URL. If this is the case I would probably use the plus '+' symbol. Many websites replace spaces with the plus symbol and so if you're aiming to parse the URL into separate words this may be easier.

The only other option I would suggest is using URL parameters like url.com?var1=term1&var2=term2 and using a .htaccess file to convert it to a clean, readable URL like url.com/term1/term2/.

The link below is a great article about using .htaccess files. The first point explains what I mentioned above.

https://moz.com/blog/htaccess-file-snippets-for-seos

-3

I guess this is the best that love the google!

/salty-recipes

I'm always using this separator for my projects.

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.