简体   繁体   English

尝试通过htaccess重定向我的wordpress网站上的所有index.html

[英]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.

相关问题 如何将 index.html 重定向到 Wordpress 站点? - How do I redirect index.html to a Wordpress site? 使用htaccess将所有请求重定向到主页(在URL中隐藏index.html) - Redirect all requests to main page using htaccess (hide index.html in URL) Nginx index.html而不是我自己的index.html - Nginx index.html instead of my own index.html 我的/index.html重定向到/ [object Object] - my /index.html is redirecting to /[object Object] 如何为网站中的index.html页面配置最佳缓存策略? - How do I configure optimal cache policy for index.html page in my site? 我的网站加载出现问题。 这是嵌入到index.html中的.SWF文件 - Having an issue with my Web site loading. This is a .SWF file embedded into the index.html 我可以在github页面站点中提供一个javascript文件而不是index.html吗? - Can I serve a javascript file instead of index.html in my github pages site? 将 DOCTYPE html 添加到我的 index.html 会破坏我的 javascript - Adding DOCTYPE html to my index.html breaks my javascript 如何将 http 重定向到 https 加上重定向`index.html` 到另一个 html 页面在 Z8052C47AB3B4ADCCC2A 一起? - how to redirect http to https plus redirect `index.html` to another html page in .htaccess together? 重定向index.html中的链接 - Redirect link in index.html
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM