且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从使用Word preSS网址htaccess的删除子文件夹

更新时间:2023-09-26 22:53:58

这应该改变 http://www.mysite.com/subfolder/ http://www.mysite.com/

  RewriteEngine叙述上
重写规则^ /子目录/(.*)$ http://www.mysite.com/$1 [L,R = 301]
 

I've moved WordPress into it's own directory as per the instruction found on the WordPress support site.

I've got his working fine but the URL now shows http://www.example.com/subfolder/ but I want it to show without the /subfolder/

I can't seem to get the htaccess to remove the /subfolder/

Here's my current htaccess code

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteRule ^(/)?$ subfolder [L]

This should change http://www.mysite.com/subfolder/ to http://www.mysite.com/

RewriteEngine On
RewriteRule ^/subfolder/(.*)$ http://www.mysite.com/$1 [L,R=301]