Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Design

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 18-09-2004, 05:24 AM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 115
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
Question Help needed on .HTACCESS

How do you redirect a domain's sub folder to another domain sub folder?

Example:
http://www.OldDomain.com/gallery --redirect to--> http://www.NewDomain.com/gallery

I sucessfully redirect http://www.OldDomain.com to http://www.NewDomain.com but not subfolder. All http://www.OldDomain.com/folderName will goto http://www.NewDomain.com

Current code:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^OldDomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.OldDomain.com$
RewriteRule ^(.*)$ http://www.NewDomain.com [R=301,L]
I have tried to append the following code, but all goto NewDomain root:
Code:
RewriteCond %{HTTP_HOST} ^OldDomain.com/gallery$ [OR]
RewriteCond %{HTTP_HOST} ^www.OldDomain.com/gallery$
RewriteRule ^(.*)$ http://www.NewDomain.com/gallery [R=301,L]
Help please? Thank you.
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 18-09-2004, 01:04 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 115
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
well, I found the answer!
Here is the code:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^OldDomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.OldDomain.com$
RewriteRule ^(.*)$ http://www.NewDomain.com/$1 [R=301,L]
by adding "/$1" at the end of redirect url, it will redirect ALL to new domain.
Example:
http://www.olddomain.com/blah/blahblah/abc.html
-->
http://www.NEWdomain.com/blah/blahblah/abc.html

__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes 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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
htaccess rewrite help needed~ lcf Website Programming 4 05-04-2007 07:45 PM
htaccess question tansks Mamak Stall 0 11-12-2006 11:18 PM
.htaccess help me. GeminiGeek Website Programming 0 25-01-2006 09:46 AM
.htaccess tansks Website Programming 4 03-01-2005 11:09 PM
ip deny htaccess KKHOSTING Website Programming 0 22-12-2004 09:43 AM



All times are GMT +8. The time now is 06:25 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59