enigmadmin Posted January 20, 2009 Share Posted January 20, 2009 hi ppl i have several domains pointing to 1 site and it should always show 1 site name in the url, even if it was called from an other. eg: how it is now - entered - displayed a.com --> a.com b.com --> a.com how it should be - entered - displayed a.com --> b.com b.com --> b.com i had a go at the htaccess file with this: RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^a\.com [NC] RewriteRule (.*) http://www.b.com/$1 [R=301,L] yet it doesnt seem to do the job, i always endup with www.a.com can someone help? doesnt even HAVE to be with htaccess, if theres an other way Quote Link to comment https://forums.phpfreaks.com/topic/141672-modify-url/ Share on other sites More sharing options...
Daniel0 Posted January 24, 2009 Share Posted January 24, 2009 It should be like this: RewriteCond %{HTTP_HOST} !^www\.b\.com$ [NC] RewriteCond (.*) http://www.b.com$1 [R=301,L] Basically saying "If hostname is not www.b.com then redirect to the corresponding address on that hostname". Quote Link to comment https://forums.phpfreaks.com/topic/141672-modify-url/#findComment-745502 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.