[英]Trying to redirect all index.html on my wordpress site through my htaccess
我正在尝试完全像我的index.php
规则一样剥离所有index.html
文件和扩展名。 意思是代替
www.discretix/modules-hdcp/index.html
应该有
www.discretix/modules-hdcp/
它适用于index.php
但不适用于index.html
。 我正在使用wordpress,而我的服务器是apache。
这些是我的htaccess规则:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~discretix/
RewriteRule ^index\.php$ - [L]
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~discretix/index.php [L]
</IfModule>
以下规则将使用301重定向(永久移动)将用户从index.html或index.php重定向到文件夹(这将反映在客户端浏览器地址栏中),您可能希望将其更改为302重定向(最初是临时重定向,但由于未指定的原因,现在通常用于指定重定向)
RewriteBase /~discretix/
RewriteRule ^index\.(html|php)$ ./ [R=301,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.