Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-10-2004, 01:50 AM
Senior Member
Latest Blog:
None

 
Join Date: 10-14-03
Location: Top left of England, UK
Posts: 132
iTrader: 0 / 0%
trevHCS is liked by somebodytrevHCS is liked by somebodytrevHCS is liked by somebodytrevHCS is liked by somebodytrevHCS is liked by somebody
Send a message via MSN to trevHCS
Quick mod_rewrite redirect query

A client of ours wants everything from one web site to redirect to the appropriate page on another domain, eg:

www.mydomain.co.uk/hotel.htm
->
www.mydomain.com/hotel.htm

...so I tried using the following in .htaccess and uploaded it to the old domain:

[code:1:25c626a5fb]RewriteEngine on
RewriteBase /

RewriteRule ^/?$ http://www.mydomain.com/ [R]
RewriteRule ^/(.+)$ http://www.mydomain.com/$1 [R,L][/code:1:25c626a5fb]


This works if you go to www.mydomain.com/ and does the redirect, but going to any page on the site doesn't cause this to redirect and I'm confused. Trouble is it's too early in the morning to be thinking about mod_rewrite so I can't work out why it's not working.

Any ideas?

Btw, I'll put in a 301 redirect also, but wanted to keep the code simple. I've also tested it on Mozilla as IE often doesn't change the address bar when it redirects (took hours of frustration to work that out once).

Trev
Digg this Post!Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_rewrite Help T0d SEO Forum 3 07-07-2006 05:33 PM
Changing forum software, trying to redirect old to new with mod_rewrite al2six Coding Forum 1 05-24-2006 07:46 AM
mod_rewrite Limit Coding Forum 0 03-31-2005 01:08 PM
Mod_Rewrite SN3 Coding Forum 1 03-06-2005 09:27 AM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 02:22 PM.
© Copyright 2010 V7 Inc
Powered by vBulletin
Copyright © 2000-2010 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.