Reply
.htaccess 301 redirect multiple directories
Old 03-25-2007, 07:00 PM .htaccess 301 redirect multiple directories
taketherisk's Avatar
Skilled Talker

Posts: 88
Name: Brett
Location: New Zealand
Hi everyone,

Could you please help me I want all folders and files to redirect to http://othersite.com/654 from mysite.com/444/*...

This is what i have so far:
Code:
RewriteEngine On 

RewriteCond %{HTTP_HOST} ^mysite.com/444/* [NC] 
RewriteRule ^(.*)$ http://othersite.com/654$1 [L,R=301]
Thanks
-Brett
__________________
My Sites:
Free Domain Names
Free Web Hosting
taketherisk is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 03-26-2007, 12:30 AM Re: .htaccess 301 redirect multiple directories
taketherisk's Avatar
Skilled Talker

Posts: 88
Name: Brett
Location: New Zealand
Does no one know how to do this?
__________________
My Sites:
Free Domain Names
Free Web Hosting
taketherisk is offline
Reply With Quote
View Public Profile
 
Old 03-26-2007, 03:14 AM Re: .htaccess 301 redirect multiple directories
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
No, sorry. I've always been pretty bad with regular expressions. But maybe what I've come up with for my own site ( with a few tutorials, and trial-and-error ) can help a little bit?

I started out calling my site LandscapePhoto.us, but then I started doing portrait photography, so the name was a bit limited, and I decided to just go with my domain name, ForrestCroce.com; the problem was to not duplicate all the content in Google's eyes, and to carry the link-juice from one domain to the other. I also decided I don't want any www subdomain. This is what I came up with:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^forrestcroce\.com [NC]
RewriteRule ^(.*) http://forrestcroce.com/$1 [R=301,L]

The ! means doesn't equal or start with, so you might be able to use that.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to .htaccess 301 redirect multiple directories
 

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11853 seconds with 12 queries