Forum Moderators: phranque
Here's the scenario.
I have a website. I just changed the theme. The theme is called in the URL.
I've got tons of referrers that come in from other sites, so I need to redirect the url to my new thems. Here's the issue:
All pages coming to this http://www.example.com/index.php?/sg_distro/comments/
Need to change this:
http://www.example.com/index.php?/en/story-details/$1
I'm assuming the $1 will allow any additional string to follow.
The articles use a directory name instead of a real file. Here is a typical link to a story:
http://www.example.com/index.php?/sg_distro/comments/hillary_flipflops/
This needs to change to this:
http://www.example.com/index.php?/en/story-details/hillary_flipflops/
of course the 'hillary_flipflops' needs to be a variable.
I've searched and the results I see just don't seem to work on this particular issue.
Any help is appreciated
[edited by: jdMorgan at 5:38 pm (utc) on Aug. 23, 2007]
[edit reason] No URLs, please. See TOS. [/edit]
Redirect /index.php?/sg_distro http://www.example.com/index.php?/en/story-details/
Redirect /index.php?/sg_distro/comments http://www.example.com/index.php?/en/story-details/
I also tried this to no avail
RewriteCond %{HTTP_HOST} ^example.com/index.php?/sg_distro/comments/ [NC]
RewriteRule ^(.*)$ http://www.example.com/index.php?/en/story-details/$1 [L,R=301]
[edited by: jdMorgan at 11:05 pm (utc) on Aug. 23, 2007]
[edit reason] Example.com [/edit]
To redirect http://www.example.com/index.php?/sg_distro/comments/<something>/ to
http://www.example.com/index.php?/en/story-details/<something>/
try:
RewriteCond %{QUERY_STRING} ^/sg_distro/comments/([^/]+)/$
RewriteRule ^index\.php$ http://www.example.com/index.php?/en/story-details/%1 [R=301,L]
Jim