Welcome to WebmasterWorld Guest from 3.93.74.227

Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Rewrite 301 Redirect or not for a Case mistake in a URL

     
12:57 pm on Feb 16, 2018 (gmt 0)

Preferred Member

10+ Year Member Top Contributors Of The Month

joined:Feb 5, 2004
posts: 618
votes: 107


So I moved from IIS to Apache. IIS is case insensitive and while I tried to be careful and keep the links all the same I missed one directory that contains a number of popular pages. This directory was referenced with all lower case letters in the menu top bar but in the side bar it was referenced with a capital letter (I have since changed the side bar link to be lower case).

www.example.com/Pages/...

and

www.example.com/pages/....

This also means I have backlinks to pages which use both versions.

To solve this issue what is better?

In .htaccess should I use a RewriteRule to do a 301 redirect or should I just rewrite the rule for Apache?

Google didn't seem to have a problem before accessing and ranking the pages via the url with a capital letter or not.

I now have a 301 redirect in place but was wondering what others have thought
7:09 pm on Feb 16, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Sept 14, 2011
posts:1045
votes: 132


Personally if its a new move, I would reinstall the original urls with mixed cases and redirect the lowercase versions.
9:06 pm on Feb 16, 2018 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15937
votes: 889


It doesn't matter whether the URLs are UPPER, lower, Mixed-Case or CamelCase, but you do need to pick one and stick with it. When-and-only-when you're sure you have made a choice you can live with, then-and-only-then should you institute a redirect for the wrongly cased versions. Alternately, you can let your server deliver a 404, which is what will happen by default. That's assuming you don't use mod_speling [sic], aka mod_duplicate_content.

This is the google subforum, but I will mention here that bing periodically likes to request /all-lower-case/ URLs for things that happen to be /Mixed-Case/. I can't be bothered to do anything about it, since it's their own choice to make the incorrect requests, so they get a 404. (Besides, I really doubt a 301 would make them stop asking any sooner.)

If you do choose a redirect, mechanics will depend on exactly how many URLs are involved. For details, wander over to the Apache subforum.
9:39 pm on Feb 16, 2018 (gmt 0)

Preferred Member

10+ Year Member Top Contributors Of The Month

joined:Feb 5, 2004
posts: 618
votes: 107


The mistake was there for years. I have switched the link to lower case (which is what it should have been) and am currently 301 redirecting to the proper URL if someone happens to visit the wrong URL with the capital letter. I much rather do this than produce a 404 error as their are 100's of pages below the directory.

From my understanding using the mod_spelling slows down servers and is not a good idea.
10:29 pm on Feb 16, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Sept 14, 2011
posts:1045
votes: 132


This is the google subforum, but I will mention here that bing periodically likes to request /all-lower-case/ URLs for things that happen to be /Mixed-Case/. I can't be bothered to do anything about it, since it's their own choice to make the incorrect requests, so they get a 404. (Besides, I really doubt a 301 would make them stop asking any sooner.)


Nice one:) never knew that but it does explain a few things, thankyou