【发布时间】:2021-03-05 21:32:00
【问题描述】:
我正在使用 WordPress,我必须将所有页面重定向到 index.html 页面(我在根文件夹中创建临时)。
我尝试了下面的代码,但它只重定向主页。
Redirect 301 "index.html" "https://www.examle.com"
我试过了
RewriteRule ^(.*)$ https://www.examle.com/$1 [R=permanent,L] //getting error(The page isn’t redirecting properly)
我试过下面的代码
RewriteCond %{REQUEST_URI} !/index.html$
RewriteCond %{REMOTE_HOST} !^00.00.00.00 //my ip
RewriteRule $ /index.html [R=302,L]
任何其他将所有页面重定向到 index.html 的解决方案?我的网站上有 50 多个页面。我想重定向 index.html 上的所有内容
【问题讨论】:
-
你能分享你当前.htaccess文件的内容吗?
-
@ozgur,我一一尝试了上面的所有,RewriteEngine On 在顶部
标签: wordpress .htaccess redirect mod-rewrite url-rewriting