.htaccess - htaccess - rewriting subdomain is breaking relative paths -


my setup using cpanel:

  1. domain.com(/public_html/)
  2. 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

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -