Solved

Mod Rewrite Problem

Posted on 2014-04-15
4
172 Views
Last Modified: 2014-04-17
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
0
Comment
Question by:sharingsunshine
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 40004241
Try these suggestions.  If they do not yield results, turn on your RewriteLog and post the entry from a single attempt to browse to a redirected page.
RewriteCond %{HTTP_HOST} ^(www\.)?naturessunshine.com$ [NC]
RewriteCond %{QUERY_STRING} ^actid=322$ [NC]
RewriteRule ^/?us/product/([^/]+)/sku-([0-9]+)\.aspx$ http://www.naturessunshine.com/us/product/$1/$2/ [R=301,L,QSA,NC]

Open in new window

0
 

Author Comment

by:sharingsunshine
ID: 40004313
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.
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 40004812
If you end up getting the log up, feel free to come back to this question.
0
 

Author Comment

by:sharingsunshine
ID: 40006338
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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question