RewriteEngine on Options +FollowSymLinks RewriteCond %{HTTP_HOST} ^mydomain\.com RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=permanent,L] works for me Expat
That works except that any time you log in with http://domain.com you end up with http://www.domain.com//page.html ... how to get rid of the extra / ?
mmmhh... try dropping the last / RewriteRule ^(.*)$ http://www.mydomain.com$1 [R=permanent,L] Although when you say log in .... is your login redirecting? The script should not add an extra /...... As the above may give problems on simple input mydonain.com expat
OK - will try. Sorry, I didn't mean anything by log in... WORKS!! Thanks!! No problem on either domain.com or domain.com/something.html Now to see if we can FINALLY budge Google over a PR of 6!
Currently I use this mod_rewrite method and have for a year or so. I am very well spidered and ranked. Not knowing how back when I did it, my urls end in /MM-fitieiwk (my product reference code) with no page extension. I see now how to do it so that they can all end in .html. But my question is....what will happen to all the pages spidered without .html......when they are re-spidered will the old ones drop off? Will my rankings rise or decline because of adding the .html ? I have 8000 products and this will change all of the urls obviously. Is it worth doing? How would I do it effectively? Can the old ones be 301 redirected to the new ones with .html using an all inclusive redirect so during the changeover they'll point to the new ones? Advice? Don't want to make another mistake.... Thanks!
Changing any static URL to another static URL would be a mistake, unless the search engines havn't found the file! If it's not broke, don't try to fix it!!! If you do it, include the 301 redirect and hope the search engines still like your listings! Just adding a .html will never help a listing. Only if for example, the new URL added the product names to the URL would I do it.
OK, I am lost, for one of my sites my url is this: .com/index.php?mode=Apparel&item=B0009VX8XQ I wrot the line in htaccess: RewriteRule ^index/(.*)/(.*)\.shtml$ index.php?mode=$1&item=$2 [L] No joy, any clues? I tried it with and without the front hacks.
Ok, lets say I add the product name to the url. Is there a way to 301 redirect ANY call to any older style rewritten url to the new one? I guess it might be redirecting an already mod rewritten url to another?
This one works fine RewriteRule ^airport-info-(.*)-(.*).htm$ uk-airport-information.htm?airport=$1&category=$2 [QSA,L] I use dashes instead of / so yours should be ^index\/(.*)\/(.*).shtml$.... if you want index/xyz/xyz.shtml Expat
yes, here is my entire htaccess: Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^index\/(.*)\/(.*).shtml$ index.php?mode=$1&item=$2 [L] Code (markup):
::RewriteRule ^index\/(.*)\/(.*).shtml$ index.php?mode=$1&item=$2 [L] Are you trying to go to domain.com/index/ANYTHING/ANYTHING.shtml or domain.com/ANYTHING/ANYTHING.shtml The code looks right if you want index/ in it. (And the script still needs to have the links changed.) There doesn't need to be \ before the /. Only for . and - . ::::;Is there a way to 301 redirect ANY call to any older style rewritten url to the new one? Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^shop/(.*)$ http://www.domain.com/$1/ [R=301,L] or RewriteRule ^whatever/$ http://www.domain.com/ [R=301,L]
OK, you lost me a bit here is the url: http://www.bestamazonprices.com/index.php?mode=PCHardware&item=B0002OZXHO Code (markup): I would like it to read: http://www.bestamazonprices.com/index/PCHardware/B0002ozxho.shtml Code (markup): Am I doing it wrong?
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^index/([^.]+)/([^.]+).shtml$ index.php?mode=$1&item=$2 [L] or RewriteRule ^index/(.*)/(.*).shtml$ index.php?mode=$1&item=$2 [L] Looks like you got it right. To see if you even got mod_rewrite support, try Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^index.shtml$ index.php [L] Then do to domain.com/index.shtml and your php script should show up. Are you on a Windows server?
Nope, apache, and suppoedly mod rewrite via htaccess is supported. I will try the above and report back.
OK, I have given up on that one for a while, time for another what do you do with the cart ID in an URL like this? cgi-bin/ecommerce/ac/agora.cgi?cart_id=1905192.84539*7z5Hx0&product=Software Code (markup):
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^cart/([^.]+)/([^.]+)\.html$ cgi-bin/ecommerce/ac/agora.cgi?cart_id=$1&product=$2 [L] domain.com/cart/whatever/whatever.html But, if it's on the same server, and the other code doesn't work, then this one probably won't work. (And only links work, not URLs generated from clicking a form button, aka shopping cart.) I'm guessing this is from the script you mentioned on that thread about CMS scripts! Good idea to make sure the URL can change before editing the script!!!
This faq is really really helped me but Im stuck here, not able to do mod rewrite for this url http:// www . com/polyphonic_tones.php?mmchar22_1=Y&mmstart22_1=1&mmsection22_1=&mmphonetype22_1 =&mmmoreinfo22_1=&mmpart22_1=&mmsearch22_1=&mmstype22_1=&mmcat22_1=&mmcountry22_1= is there way to do mod_rewrite for this? Thanks