Mixing hyphens and underscores in a url
-
Hello.
I am working on a site that was built with underscores in the urls, but only in the page names, not in the subdirectories. All the subdirectories have one-word names.
So a typical url is "example.com/sub1/sub2/page_name."
We would like to change the name of one of the subdirectories to a name that would be very useful for SEO, but this new name is a hyphenated word, let's call it "new-sub."
If we changed "sub2" to "new-sub" then our url would have a mix of underscores and hyphens: example.com/sub1/new-sub/page_name. But if I used "new_sub" instead, google would read the words as connected with an underscore, instead of reading the subdirectory as a hyphenated word, which would be less useful for SEO.
It seems like it might be a problem to have a hyphen in a subdirectory and underscores in the page names. But I want the SEO value of the hyphenated word.
Any recommendations?
Thank you!
-
Thank you!
-
Thank you, Ian!
-
Any recommendations?
If this was my site I would not worry about it.
-
Matt Cutts did a video on this exact issue.
http://www.youtube.com/watch?v=AQcSFsQyct8
Generally, you should just stick to either underscores or hyphens and not mix the two.
If you want to change all of the underscores to hyphens then make sure you 301 redirect all of the old urls to the new ones. This can be a total pain if your site is huge, but would be necessary if you change the URLs.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Virtual URL Google not indexing?
Dear all, We have two URLs: The main URL which is crawled both by GSC and where Moz assigns our keywords is: https://andipaeditions.com/banksy/ The second one is called a virtual url by our developpers: https://andipaeditions.com/banksy/signedandunsignedprintsforsale/ This is currently not indexed by Google. We have been linking to the second URL and I am unable to see if this is passing juice/anything on to the main one /banksy/ Is it a canonical? The /banksy/ is the one that is being picked up in serps/by Moz and worry that the two similar URLs are splitting the signal. Should I redirect from the second to the first? Thank you
On-Page Optimization | | TAT1000 -
Redirects for new site new urls?
If redoing a site and updating some of the url's for SEO should you do permanent redirects for the old sites url's ? Using WordPress. I saw that the Yoast Pro plugin allows you to do this inside WordPress , is this the best way? Suggestions.? I know there are old articles written out on the web pointing back to the what will be soon old url's so just wondering what's the best way to go about this. Thanks Scott
On-Page Optimization | | scott3150 -
Url structure with dash or slash
Hi There We have a content website. We don't rank well category image related searches but we get quite good traffic for those keywords. Those keywords are mostly like "category images". We want to change our url structure and we have 2 options now. 1- domain.com/category/category-images 2-domain.com/category/images option 1 repeats the category name so it looks spammy option 2 doesn't really have the keyword. any ideas which one tho choose? Thanks! ps: we don't want to use domain.com/category-images (too many root link)
On-Page Optimization | | muminaydin0 -
URL / Meta info for Author bio pages
When you create a biography page for authors that point back to their G+ account, do you include any other signals in the URL other than the authors name? For example, would you use www.domain.com/sam-spade or www.domain.com/sam-spade-biography, etc? Similar question for the meta description. Do you add any signals there? Or, is rel=author strong enough. Best,
On-Page Optimization | | ChristopherGlaeser
Christopher0 -
URL Structure
What's the best way to set up a url structure? When a user goes through the funnel should it show it in the url? Like this: domain.com/thickness/high-density/1-mil-plastic-bags (1 mil plastic bags is a subcategory - when the user is at this page they will see many products. When they select one - it brings them to a product detail page which I think should be done like this: domain.com/product-name regardless of the funnel that brought them there. Does this make sense?) or **domain.com/1-mil-plastic-bags ** Also, is there a limit of how many "/" could be used?
On-Page Optimization | | EcomLkwd0 -
Should ".html" in the URL or not?
Does URL like /wedding-dresses.html/f/price/2,100 with "html" in the middle do harm to SEO? Should I drop the ".html"?
On-Page Optimization | | StevenRoland0 -
Index.php + external site added to end of URL
Good day, I have a domain http://www.ecofriendlylink.com. I am trying to resolve the Crawl Diagnostic errors on it. I have several Duplicate Page Content errors. Example 1: (The domain happynewyou is not mine, some Comments from them have been placed on my site. Ecoshop.php is a page on my site). URL: http://www.ecofriendlylink.com Duplicate Page Content: http://www.ecofriendlylink.com/www./happynewyou.com/ecoshop.php Referrer: None. Example 2: URL: http://ecofriendlylink.com/index.php Duplicate Page Content: http://www.ecofriendlylink.com/index.php http://www.ecofriendlylink.com/www./happynewyou.com/index.php Referrer: http://ecofriendlylink.com/ Example 3: is a different problem, but still a Dup Page Error. URL: http://ecofriendlylink.com/water.php Duplicate Page Content: http://www.ecofriendlylink.com/water.php Referrer: http://ecofriendlylink.com/ water.php is a page on my main domain. The www version and the non-www version, if this a problem and something I need to overcome? So please can you advise what I need to do to get rid of this strange external domain name + index.php (as per examples 1 + 2), and explain what I'm doing wrong with Ex 3. Thank you!
On-Page Optimization | | drkevinhogan0 -
How important is it to include the target keyword phrase in the page URL?
If I want to target a keyword phrase to a particular phrase, but do not want to change the URL of that page, will that negatively impact my rankings? I am also wondering if I can get around it by creating a new, short URL that 301 redirects to the original URL. Would that be as effective as including the keyword in the original URL?
On-Page Optimization | | susannajbost0