Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-17-2007, 04:06 PM   PM User | #1
suzkaw
New Coder

 
Join Date: Dec 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
suzkaw is an unknown quantity at this point
htaccess 301 help

Hi,

I have moved a folder on a site and I am wanting to do a 301 redirect on the old folder.

So I have created my .htaccess file and included this:
Code:
Redirect 301 /sites/ http://www.mysite.com/links/
This works and redirects however if the user visits sites/cat/animals/ it will redirect to links/cat/animals/

So I am basically needing a way for it to drop anything after sites/. Is this possible?
__________________
--
Thanks,
Eric
Classifieds Software
suzkaw is offline   Reply With Quote
Old 08-17-2007, 05:32 PM   PM User | #2
Pennimus
Senior Coder

 
Join Date: Jul 2005
Location: UK
Posts: 1,051
Thanks: 6
Thanked 13 Times in 13 Posts
Pennimus is on a distinguished road
Yes it's certainly possible using regular expressions. Though, this isn't a PHP question, it probably belongs in "other server side languages/issues" or "general web building".

But in the meantime you can look up mod_rewrite regular expressions and take a stab yourself.
Pennimus is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:48 AM.


Advertisement
Log in to turn off these ads.