Forum Moderators: phranque

Message Too Old, No Replies

Old pages are capitalized, and space isreplaced by - , new ones aren't

is there apache rewrite hope?

         

walkman

10:34 pm on May 2, 2005 (gmt 0)



is it possible to do via rewrite? I mean send
ProductName-keyword > productname-keyword and
product%20two-keyword > product-two-keyword
I have over 1200 pages and robots is not feasible. Even the Capitalize alone would help a lot...

I think this would be the starting point..unless I'm wrong :)

RewriteEngine on
RewriteRule ^(.+)-keyword$ /$1-keyword [L]

once again, any help would be greatly appreciated.

jdMorgan

3:19 am on May 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Walkman,

This capitalization problem is a big one. Mod_rewrite can be used to fix it, but it is only reasonably efficient if you put the code in httpd.conf. In httpd.conf, you can use mod_rewrite's RewriteMap directive to do case-conversion; see the example given in the Apache mod_rewrite RewriteMap documentation [httpd.apache.org].

In .htaccess, this function is not available, and you basically have to have 26 RewriteRules -- one for each capital letter, and run the URL through those rules repeatedly until all capital letters are converted to lowercase. This is horribly inefficient, and I would not recommend it on any site that gets more than a few thousand visitors a day.

You can also look into mod_speling [httpd.apache.org], which can "look up" closely-related URLs if the requested URL is not valid. This is only good for correcting capitalization and a few incorrect characters in each URL, though.

Jim

[edited by: jdMorgan at 5:51 am (utc) on May 3, 2005]

walkman

5:36 am on May 3, 2005 (gmt 0)



Thanks JD,
CheckSpelling would've been perfect if didn't bring the URLs that I rewrote. Apparently it scans and serves the physical ones from the directory.

Looks like I need to wait and see (GoogleBot already found tons of 404s) and then manually redirect those with IBL.

thanks again,