| Private Hosting Questions about VPS, dedicated servers and colocation. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
|
|
#1 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2005
12 posts
Gave thanks: 2
Thanked 0 times
|
htaccess help
I have tried to figure this out, but can't seem to get it.
I'm redirecting my top level (www.hotcouponwworld.com) to www.hotcouponworld.com/forums I have added a store sub-domain (stores.hotcouponworld.com), but when I got to it I get redirected back to the forums. Code:
#RewriteBase /
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^stores/?$ http://stores.hotcouponworld.com/index.php [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.hotcouponworld\.com
RewriteRule (.*) http://www.hotcouponworld.com/forums/$1 [L,R=301]
Mark |
|
|
|
|
|
#5 (permalink) | |
|
Surpass Fan
Excelling Contributor
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
937 posts
Gave thanks: 2
Thanked 95 times
|
Quote:
Your store rule is looking only for hotcouponworld.com/stores and not the subdomain stores.hotcouponworld.com. The second rule will not redirect your domain itself to the forum and is seeing stores. as not www. Try: Code:
RewriteCond %{HTTP_HOST} ^stores.*$
RewriteRule .* http://stores.hotcouponworld.com/index.php [R=301,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^stores/?$ http://stores.hotcouponworld.com/index.php [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.hotcouponworld\.com/?.* [NC,OR]
RewriteCond %{HTTP_HOST} ^hotcouponworld\.com/?.* [NC]
RewriteRule (.*) http://www.hotcouponworld.com/forums$1 [L,R=301]
__________________
Where would you be if you were at the highest court in the land (US)? |
|
|
|
|
| This user thanks cowboy for this great post! | markp_2000 (September 22nd, 2007) |
|
|
#6 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2005
12 posts
Gave thanks: 2
Thanked 0 times
|
Thanks, I got it to work for stores.hotcouponworld.com but not www.hotcouponworld.com/stores
It gives me errors. I don't think this is a rewrite rule though. Mark |
|
|
|
|
|
#7 (permalink) | |
|
Surpass Fan
Excelling Contributor
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
937 posts
Gave thanks: 2
Thanked 95 times
|
Quote:
Code:
RewriteRule ^.*stores.*$ http://stores.hotcouponworld.com/index.php [R=301,L] To verify your actual url that you are passing, make a small PHP script and name it like testredirect.php in your public_html directory. PHP Code:
Code:
RewriteCond %{HTTP_HOST} ^.*$ [NC]
RewriteRule (.*) http://www.hotcouponworld.com/testredirect.php?test=$1 [L,R=302]
(When using ^.*$ as conditiion, hurry and comment out the condition and rule with # so your whole site is not being redirected for your visitors for long.) .
__________________
Where would you be if you were at the highest court in the land (US)? |
|
|
|
|