htaccess redirect + hide subfolder in url

前端 未结 1 409
孤城傲影
孤城傲影 2021-01-12 07:27

I\'ve looked around and have attempted some rules and conditions that worked; while some did not work or the condition would capture too much causing other domains to also r

相关标签:
1条回答
  • 2021-01-12 08:01

    Try this rule:

    # remove www
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [NE,R=301,L]
    
    RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$
    RewriteRule !^subfolder/ /subfolder%{REQUEST_URI}  [L]
    
    0 讨论(0)
提交回复
热议问题