Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 重定向到子文件夹并删除url htacces中的子文件夹名称_Wordpress_.htaccess - Fatal编程技术网

Wordpress 重定向到子文件夹并删除url htacces中的子文件夹名称

Wordpress 重定向到子文件夹并删除url htacces中的子文件夹名称,wordpress,.htaccess,Wordpress,.htaccess,我知道这个问题很难回答,但我是htaccess的新手 public_html --htaccess --myfolder --htaccess 我在我的文件夹中安装了我的wp,在我的第一次访问中,我将 RewriteCond %{HTTP_HOST} ^(www\.)?mywebsite\.com$ [NC] RewriteRule !^myfolder/ /myfolder%{REQUEST_URI} [L,NC] 我的问题是,当我单击我的链

我知道这个问题很难回答,但我是htaccess的新手

public_html  
    --htaccess  
    --myfolder  
        --htaccess  
我在我的文件夹中安装了我的wp,在我的第一次访问中,我将

RewriteCond %{HTTP_HOST} ^(www\.)?mywebsite\.com$ [NC]
RewriteRule !^myfolder/ /myfolder%{REQUEST_URI} [L,NC]
我的问题是,当我单击我的链接时,url会显示在此表单中

www.mywebsite.com/myfolder/page/ 
我怎样才能把它做成一种

www.mywebsite/page/
我没有在我的文件夹中的htaccess中放入任何内容。
非常感谢您的帮助。

请在myfolder.htaccess文件中使用此文件,以便重定向

RewriteEngine On
RewriteRule ^(.*)$ /$1 [R=301,L]
www.mywebsite.com/myfolder/page/

www.mywebsite.com/page/


您可以先删除位于您的/public\u html或myfolder中的.htaccess文件吗?我认为它位于我的文件夹中,这就是为什么它在URL中显示我的文件夹是的,我在我的文件夹中安装了我的wordpress。感谢您的澄清我在wordpress的设置下使用permalink解决了这个问题。在我删除了htaccess文件public_html之后,我使用了您的代码,结果是404