apache - Domain .htaccess redirect issue -
i'm trying create redirects .htaccess never manage functional. maybe here can me.
what need is:
http://domain.se
,http://domain.com
redirecthttp://www.domain.com
.i need
http://domain.se/somefolder
,http://domain.com/somefolder
http://www.domain.se/somefolder
redirecthttp://www.domain.com/folder
.
i've tried accomplish myself end errors data not being sent.
options +followsymlinks -multiviews rewriteengine on rewritebase / # folder rewrite rewriterule ^somefolder$ folder [l] # domain redirect rewritecond %{http_host} =domain.com [or] rewritecond %{http_host} =domain.se rewriterule (.*) http://www.domain.com/$1 [r=301,l]
this placed in .htaccess file in website root folder. if placed elsewhere tweaking may required.
first rule rewrite (internal redirect) requests
/somefolder
/folder
. if need 301 permanent redirect, replace[l]
[r=301,l]
second rule domain redirect job. rule redirect if domain
domain.com
ordomain.se
. if want have redirect domain name (that webserver configured can serve)www.domain.com
replace 2 rewritecond lines one:rewritecond %{http_host} !=www.domain.com
.
Comments
Post a Comment