htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Help fixing redirect
PostPosted: 13 Sep 2008 15:04 
Offline

Joined: 13 Sep 2008 14:50
Posts: 1
I need help redirecting in .htaccess

from:
‎‎/boys-shoes-c-23_24.html?page=2&sort=2a
‎‎/boys-shoes-c-23_24.html?page=2&sort=4a
to:
http://mysite.com‎/boys-shoes-c-23_24.html

and
from:
‎‎/swaddle-designs-c-27_77_14.html?page=2&sort=4a
to:
http://mysite.com‎/swaddle-designs-c-27_77_14.html

- the "-c-" is in all urls
- the text before and the numbers after the "-c-" are the same in the from: and to:, but there are many of these different instances
- "?page=...." anything after .html is what I want to eliminate and redirect to the url without these extra characters

I am no expert, but tried putting the part before and after the "-c-" in variables as:
^(.*)-c-(.*).html\?(.*) http://mysite.com/$1&%-c-$2&%.html
but did not work, sure something wrong in the writing.

There must be a way to do this in 1 line of mod_rewrite.
Any help is appreciated


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: MSNbot Media and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB