.htaccess - htaccess - rewriting subdomain is breaking relative paths -
my setup using cpanel:
- domain.com(/public_html/)
- mysub.domain.com(/public_html/2013/sitepath/)
goal: sub2.mysub.domain.com/save-path-info redirect mysub.domain.com/save-path-info without change url sub2.mysub.domain.com. in other words, want anysub.mysub.domain.com virtually exact same mysub.domain.com.
code:
options +followsymlinks options +indexes rewriteengine on rewritecond %{env:redirect_status} ^$ rewritecond %{http_host} !^www\.2013.cqueue\.com$ [nc] rewritecond %{http_host} ^(www\.)?([^\.]+)\.2013.cqueue\.com$ [nc] rewriterule (.*) /2013/sitepath/$1 [l] the code above in root directory of mysub.domain.com wasn't working until moved root directory of domain.com. keeps url , path, breaking relative path of templates.
example: templates path / but, rewrite above templates think need in /2013/sitepath/
edit
options +followsymlinks options +indexes rewriteengine on rewritecond %{http_host} ^[^\.]+\.mysub\.domain\.com$ [nc] rewriterule ^(.*)$ http://mysub.domain.com/$1 [l] # -frontpage- indexignore .htaccess */.??* *~ *# */header* */readme* */_vti* <limit post> order deny,allow deny allow </limit> <limit put delete> order deny,allow deny </limit> authname domain.com authuserfile /home/uadmin/public_html/_vti_pvt/service.pwd authgroupfile /home/uadmin/public_html/_vti_pvt/service.grp
try code :
rewriteengine on rewritecond %{http_host} ^[^\.]+\.mysub\.domain\.com$ [nc] rewriterule ^(.*)$ http://mysub.domain.com/$1 [l]
Comments
Post a Comment