Change subfolder to another subfolder with 2 diff links

Using mod_rewrite to handle various content issues

Change subfolder to another subfolder with 2 diff links

Postby Simplyput » Fri May 30, 2008 11:14 pm

Issue 1

I need to change this

http://www.mysite.com/subfolder1/index. ... odockID=11

To this

http://www.mysite.com/subfolder2/index. ... mmas+house

My solution is this.

RewriteCond %{QUERY_STRING}^members/index\.php?t= [NC]
RewriteRule ^members/index\.php?t=browse_event&search_area=event_location&search_string=([0-9-a-zA-Z]+)$ /music/index.php?t=browse_event&search_area=event_location&search_string=([0-9-a-zA-Z]+) [R=301,L]


However I have the same issue with another almost identical link.

A.

http://www.mysite.com/subfolder1/index. ... odockID=11

Need to change to the following.

http://www.mysite.com/subfolder2/index. ... odockID=11

My solution above will not work for this link because the year, month and day will always change. I am at my limit of mod rewrite skills any assistance will be nice.
Simplyput
 
Posts: 4
Joined: Tue Oct 30, 2007 10:40 pm

Postby richardk » Sun Jun 01, 2008 10:15 am

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{QUERY_STRING} ^(.*&)?t=browse_event(&.*)?$ [NC]
RewriteRule ^subfolder1/index\.php$ /subfolder2/index.php [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Content

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron