Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 08-08-2009, 06:07 AM   #1
Member (5 bit)
 
Join Date: Oct 2008
Posts: 16
htaccess issue

Am supporting a wordpress based web design for a domain domain1.com .

There is another domain domain2.com added as a alias of domain.com.

Using .htaccess I was able to redirect comain1.com to domain1.com/web using the sample code below:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?domain1.com$ [NC]
RewriteCond %{REQUEST_URI} !^/web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /web/$1
RewriteCond %{HTTP_HOST} ^(www.)?domain1.com$ [NC]
RewriteRule ^(/)?$ web/ [L]


I will need domain2.com to point to domain1.com/web/fitness (this is a page of wordpress). I added futher to htaccess as:

RewriteCond %{HTTP_HOST} ^(www.)?domain2.com$ [NC]
RewriteCond %{REQUEST_URI} !^/web/fitness/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /web/fitness/$1
RewriteCond %{HTTP_HOST} ^(www.)?domain2.com$ [NC]
RewriteRule ^(/)?$ web/fitness/ [L]

This does not work and I am very sure I am wrong. Appreciate your assistance on how to get domain2.com to redirect to domain1.com/web/fitness
namvijay is offline   Reply With Quote
Old 08-08-2009, 02:31 PM   #2
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
Try removing the "RewriteCond %{REQUEST_URI} !^/web/fitness/" line.
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.
Force Flow is offline   Reply With Quote
Old 08-12-2009, 05:30 AM   #3
Member (5 bit)
 
Join Date: Oct 2008
Posts: 16
Nope it is not working. Any further suggestions?
namvijay is offline   Reply With Quote
Old 08-12-2009, 09:46 AM   #4
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
Give ths a try

Code:
RewriteCond %{HTTP_HOST} ^domain2\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain2\.com$
RewriteRule ^(.*)$ http:\/\/domain1\.com/web/fitness [R=301,L]
Force Flow is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


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



All times are GMT -5. The time now is 07:42 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2