繁体   English   中英

301重定向到子文件夹,但有输入

[英]301 Redirect to subfolder but with input

我希望我的wordpress网站重定向能够记住该URL,但要将其放在子文件夹中。

因此, http://www.example.com/test123必须重定向到http://www.example.com/voetbal/test123

并将http://www.example.com/0239更改为http://www.example.com/voetbal/0239

我的htaccess看起来像这样。

RewriteEngine On
RewriteBase /voetbal/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /voetbal/index.php [R=301, L]

这使我的网站从http://www.example.com转到http://www.example.com/voetbal/,但只有根目录。

我如何让htaccess记住人们的输入并将其放置在/ voetbal /之后

尝试:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /voetbal%{REQUEST_URI} [L,R=301]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM