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 redirect old domain to new
Old 01-18-2010, 12:02 PM .htaccess redirect old domain to new
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
So far I have this code that has been automatically generated by Wordpress to define the permalink structure:

Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
Does anyone know how I should update it to forward my old domain to my new domain?

Basically I have:

Code:
newdomain.com and olddomain.com
Both pointing to the same location, if I visit olddomain.com then it shows in the address bar, however if I then click any link on the site, the address changes to newdomain.com

But how would I set it so that anyone who visits olddomain.com will be automatically forwarded to newdomain.com?

Thanks
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 01-18-2010, 06:11 PM Re: .htaccess redirect old domain to new
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Try this

Code:
RewriteCond %{HTTP_HOST} ^(www\.)?OLD\.com$ [NC]
RewriteRule .* http://www.NEW.com%{REQUEST_URI} [R=301,L]
You'll need to change OLD and NEW to your domains of course.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 01-18-2010, 06:52 PM Re: .htaccess redirect old domain to new
Junior Talker

Posts: 4
Name: Nilber
Trades: 0
I use:

redirect 301 /url_old.html http://www.dominio-new.com/url-nova/
nb-master is offline
Reply With Quote
View Public Profile Visit nb-master's homepage!
 
Old 01-19-2010, 05:24 AM Re: .htaccess redirect old domain to new
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Thanks, would either of these work if I simply added it after my existing .htaccess code? Or should I replace part of it?
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 01-19-2010, 05:39 AM Re: .htaccess redirect old domain to new
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
put your redirect first in the .htaccess
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-20-2010, 05:35 PM Re: .htaccess redirect old domain to new
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Great thanks, all sorted now
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Reply     « Reply to .htaccess redirect old domain to new
 

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.56904 seconds with 12 queries