.htaccess - set a subdomain with redirect to the index page -
i have domain abdefg.it.
i have set subdomain sub.abcdefg.it pointing in directory contain:
index.php foldera .htaccess
the problem if type url sub.abcdefg.it
error appear, if type sub.abcdefg.it/index.php
goes well.
that contained in .htaccess file
rewriteengine on rewritecond %{http_host} ^sub\.abcdefg\.it$ [or] rewritecond %{http_host} ^www\.sub\.abcdefg\.it$ rewriterule ^/?$ "http\:\/\/www\.abcdefg\.it\/sub\/index\.php" [r=301,l]
what doing wrong?
thanks you.
you can that:
rewriteengine on rewritecond %{http_host} ^(?:www\.)?sub\.abcdefg\.it$ rewriterule .* http://www.abcdefg.it/sub/index.php [r=301,l]
now, redirect http_host.
before work well, use [r=302,l] tests, without cache.
Comments
Post a Comment