ultrus Posted September 7, 2011 Share Posted September 7, 2011 Hello, I have an event site. At the moment last year's event links are being redirected from the current site to a 2011.mysite.com website (so the pages don't break and people can see what happened). example: mysite.com/agenda -> 2011.mysite.com/agenda If visiting the home page, people get redirected to a landing page on the current site like this: mysite.com -> mysite.com/event2012 Here's what's new. I want to NOT redirect people if they access anything in the new "staging" folder: mysite.com/staging/agenda = mysite.com/staging/agenda How do I do this while keeping everything else in tact? Here's my current .htaccess contents Options +FollowSymLinks RewriteEngine on RedirectMatch 301 ^/$ http://www.mysite.com/event2012/index.html RewriteRule ^$ event2012 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^index.htm RewriteRule ^(.*)$ http://2011.mysite.com/$1 [L,QSA] Thanks for the assist in advance! EDIT: I was going to replace RewriteCond %{REQUEST_URI} !^index.htm with RewriteCond %{REQUEST_URI} !^staging But that doesn't seem to make a difference. Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/246631-htaccess-redirect-zoo-a-small-managable-petting-zoo-that-needs-love/ Share on other sites More sharing options...
ultrus Posted September 7, 2011 Author Share Posted September 7, 2011 I was very close. I had to revise: RewriteCond %{REQUEST_URI} !^staging to: RewriteCond %{REQUEST_URI} !^/staging Life is now good. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/246631-htaccess-redirect-zoo-a-small-managable-petting-zoo-that-needs-love/#findComment-1266451 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.