.htaccess hide subdirectory url after redirect

前端 未结 3 696
余生分开走
余生分开走 2021-01-13 16:50

I\'m redirecting a website to a subdirectory I created. The subdirectory contains an installation of WordPress and now I want to mask the subdirectory url from the website.<

3条回答
  •  自闭症患者
    2021-01-13 17:00

    If you want to remove /apt from url why do you redirect "/" to "/apt"? Try this:

    RewriteRule !^apt/ /apt%{REQUEST_URI} [L,NC]
    

    instead of

    RewriteRule ^/?$ "http\:\/\/www\.mywebsite\.com/\apt" [R=301,L]
    

    With this rewrite you should see your application in /apt folder under url www.mywebsite.com

提交回复
热议问题