Question

I have a problem. The name of my homepage is as example "blabla.org". But the Home Site is on "home.blabla.org". I have a htaccess, which redirects me to "home.blabla.org" if i go to "blabla.org" But if i want to go to "blabla.org/test.html" ist redirects me to "home.blabla.orgtest.html"

How can I fix that?

Here my htaccess:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?blabla\.org$ [NC]
RewriteRule ^(.*)$ http://home.blabla.org$1 [R=301,L]
Was it helpful?

Solution

This is what you need to redirect only the homepage :

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?blabla\.org$ [NC]
RewriteRule ^$ http://home.blabla.org [R=301, L]

Edit : to redirect homepage of every subdomain, you just have to do the same and exclude only home.blabla.org :

RewriteEngine On

RewriteCond %{HTTP_HOST} !^home\.blabla\.org$ [NC]
RewriteRule ^$ http://home.blabla.org [R=301, L]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top