Jump to content

.htaccess redirect zoo (a small managable petting zoo that needs love)


ultrus

Recommended Posts

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

 

:facepalm: 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!  :D

 

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.