Forum Moderators: phranque
First I must say, thta although I know what an .htacess file is and why we use it, my knowledge of hpw to a command together is very poor, so i am looking for advice.
I need to redirect or rewrite one folder in the rule from lower case to upper case.
My existing estblished url is like this
myurl/Car/UPPERCASE/
or
myurl/Car/UPPERCASE/More-files-here/
I am only iterested in the UPPERCASE area.
I have been lucky enough to recieve a lot or links to all the uppercase catergories.
However I have recently has a rankings drop and so have noticed that all these links, link to me using lower case i.e. myurl/Car/uppercase/
the content for theses page are generated, and so delivers 2 different sets of content for the same url written either in lower case or lower case.
I have tried a standard 30 direct, but it adds presents a string at the end of /UPPERCASE/ in the browser I did not create
i.e. /UPPERCASE/?unwritten string about catagories in site
So i think I need a rewrite that will always rewrite the /UPPERCASE/ file to lowercase. i.e/ myurl/Car/uppercase/
can anyone help, knowing I know litle about how to write this.
thanks
Mark
A redirect forces the browser to make a new request for the content, but at the correct URL for it. This is much more friendly to search engines and users.
Based on that, which one do you actually want?
Also, if you have any other URLs in the form /w/x/y or /w/x/y/z (which match your UPPERCASE examples), then you will need to do one of two things: Either specifically list all UPPERCASE directories which are currently linked-to incorrectly as lowercase, or list all *other* URL-paths that *do not* need to be forced to uppercase.
This is necessary because otherwise, second-level directory-path-part (the "x" in my example URL-path templates above) will always be forced to uppercase, even if the request was for (as an example) "/images/logos/widgetcom.gif".
Another possibility is that you may be able to use some other attribute of the requested URL to allow the code to decide whether or not to force uppercase. An example would be, "if the top-level directory is 'Car', then force uppercase in the second-level directory", or something similar. Since we're not familiar with your URL-architecture, only you can answer this question.
Again, the solution to this problem is going to be complex, and very slow and inefficient. If this were my site, I would get started now to adopt all-lowercase URLs for future use. In fact, I would change my directory filepaths to all-lowercase, and redirect any and all requested URLs containing uppercase characters to all-lowercase, instead of the other way around, as we're discussing here.
Jim
Thanks for the reply.
I do have access to the server.
I accept the urls should all be lower case, it is just too late in my opinion to risk doing it
We have over 4000 uniques every day and until this isse became apparent, were number one for as competitive term
To change the urls, represents to much of a risk.
I have found a redirect that takes the inacurate incomming links that create the page to a 404.
It means I lose link value (probaly never had it anyway).
But that is less risky than having duplicate(similar) content pages or urls.
Thanks again for you reply.
Mark
If you adopted all-lowercase URLs page-by-page or small-section-by-section over the next several months, temporary loss of ranking would be a non-issue. In addition, you could use a RewriteMap in httpd.conf (or other server-config file, not available in .htaccess) to call the operating system's tolower function, fixing all uppercase characters all at once. If you retain capital letters, then you have to use some kind of exclusion, for example, do not lowercase the initial letter of each URL-path-part (as defined by the slashes).
You might also want to look into mod_speling as an alternative to mod_rewrite. Performance testing should quickly tell you whether the mod_rewrite or mod_speling option is better.
At any rate, you probably want a 301 redirect in order to retain your PageRank/Link-popularity/TrustRank.
Jim