Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



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

Posts: 89
Name: Brett
Location: New Zealand
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
taketherisk is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-26-2007, 12:30 AM Re: .htaccess 301 redirect multiple directories
taketherisk's Avatar
Skilled Talker

Posts: 89
Name: Brett
Location: New Zealand
Trades: 0
Does no one know how to do this?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
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,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to .htaccess 301 redirect multiple directories
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





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



Page generated in 0.20179 seconds with 12 queries