[英]Trying to redirect all index.html on my wordpress site through my htaccess
I'm trying to strip all index.html
file & extension exactly like my index.php
rule works. 我正在尝试完全像我的
index.php
规则一样剥离所有index.html
文件和扩展名。 Meaning that instead of 意思是代替
www.discretix/modules-hdcp/index.html
There should be 应该有
www.discretix/modules-hdcp/
It works for index.php
but in index.html
it Doesn't. 它适用于
index.php
但不适用于index.html
。 I'm using wordpress and my server is apache. 我正在使用wordpress,而我的服务器是apache。
These are my htaccess rules: 这些是我的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>
The following rule will redirect the user from either index.html or index.php to the folder (this will be reflected in the clients browser address bar) using a 301 redirect (moved permanently), you might want to change this to 302 redirect (originally temporary redirect, but now commonly used to specify redirection for unspecified reason) 以下规则将使用301重定向(永久移动)将用户从index.html或index.php重定向到文件夹(这将反映在客户端浏览器地址栏中),您可能希望将其更改为302重定向(最初是临时重定向,但由于未指定的原因,现在通常用于指定重定向)
RewriteBase /~discretix/
RewriteRule ^index\.(html|php)$ ./ [R=301,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.