Jump to content

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


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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.