Link to home
Start Free TrialLog in
Avatar of sharingsunshine
sharingsunshineFlag for United States of America

asked on

Mod Rewrite Problem

I have several hundred links that need to be changed due to a vendor changing their product url's.

Here is an example of the original url

http://www.naturessunshine.com/us/product/tofu-moo-natural-225-oz/sku-1703.aspx?actid=322

Here is what I need to change it to

http://www.naturessunshine.com/us/product/tofu-moo-natural-225-oz/1703/?actid=322

This is the rewrite I built but it doesn't seem to do anything.

RewriteCond %{HTTP_HOST} ^www.naturessunshine.com$ 
RewriteCond %{QUERY_STRING} ^actid=322$
RewriteRule ^us/product/(.+)/sku-([0-9]+)\.aspx$ http://www.naturessunshine.com/us/product/$1/$2/ [R=301,L,QSA]

Open in new window


This is above the rewrite string I created

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.abc.com
AuthUserFile /var/www/html/_vti_pvt/service.pwd
AuthGroupFile /var/www/html/_vti_pvt/service.grp

Open in new window


Please tell me what I need to do to get this rewrite to work.

Thanks,

Randal
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sharingsunshine

ASKER

That doesn't do it and the techs are chasing down another issue on the server so I can't touch the rewrite log.

I went ahead and just copied down the tables to my desktop and ran a grep on them and change all of the links.

So your suggestion for the rewrite log is probably the way to go.
If you end up getting the log up, feel free to come back to this question.
That's very nice of you to offer. HostGator was down since 11 AM on the 16th so will take you up on that soon as I get caught up.