Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在wordpress中重定向301_Php_Wordpress_.htaccess - Fatal编程技术网

Php 如何在wordpress中重定向301

Php 如何在wordpress中重定向301,php,wordpress,.htaccess,Php,Wordpress,.htaccess,如何使用wordpress中的.htaccess文件进行301重定向 www.mysite.com/about.html/page1 www.mysite.com/about.html/page2 www.mysite.com/about.html/page3 www.mysite.com/about.html/page(anypage) 重定向到 www.mysite.com/ 我怎么能这样重定向呢 我不工作 Redirect 301 about.html/ / 结果是www.mysi

如何使用wordpress中的.htaccess文件进行301重定向

www.mysite.com/about.html/page1
www.mysite.com/about.html/page2
www.mysite.com/about.html/page3
www.mysite.com/about.html/page(anypage)
重定向到

 www.mysite.com/
我怎么能这样重定向呢

我不工作

Redirect 301 about.html/ /
结果是
www.mysite.com//page1
这是错误的。我想将整个url重定向到我的主页。

尝试以下操作:

RewriteRule ^about\.hrml(.*)$ http://www.example.com/ [R=301,L]
模式匹配以
about.hrml
开头的任何字符(注意
hrml
之前的
是转义的,因为它是正则表达式,
表示任何非换行符)。用您自己的URL重定向到您的网站(替换)
R=301
告诉服务器使用301代码,而
L
意味着这应该是最后一条规则。

试试这个:

RewriteRule ^about\.hrml(.*)$ http://www.example.com/ [R=301,L]
模式匹配以
about.hrml
开头的任何字符(注意
hrml
之前的
是转义的,因为它是正则表达式,
表示任何非换行符)。用您自己的URL重定向到您的网站(替换)
R=301
告诉服务器使用301代码,而
L
意味着这应该是最后一条规则。

试试这个:

RewriteRule ^about\.hrml(.*)$ http://www.example.com/ [R=301,L]
模式匹配以
about.hrml
开头的任何字符(注意
hrml
之前的
是转义的,因为它是正则表达式,
表示任何非换行符)。用您自己的URL重定向到您的网站(替换)
R=301
告诉服务器使用301代码,而
L
意味着这应该是最后一条规则。

试试这个:

RewriteRule ^about\.hrml(.*)$ http://www.example.com/ [R=301,L]

模式匹配以
about.hrml
开头的任何字符(注意
hrml
之前的
是转义的,因为它是正则表达式,
表示任何非换行符)。用您自己的URL重定向到您的网站(替换)
R=301
告诉服务器使用301代码,而
L
意味着这应该是最后一条规则。

我认为您需要设置重写基,而不是像
Redirect 301^about.hrml.*$/
这样的东西,我认为您需要设置重写基,而不是像
Redirect 301^about.hrml.*$/
这样的东西,我认为您需要设置rewritebase和类似于
Redirect 301^about.hrml.*$/
我认为您需要设置rewritebase和类似于
Redirect 301^about.hrml.*$/
您好,@jonathon您能帮我吗?对不起,我正在键入html作为我在htaccess下面添加的代码的hrml。你能检查我的代码吗?
#在RewriteBase/RewriteRule^index\.php$-[L]RewriteCond%{REQUEST_FILENAME}上启动WordPress RewriteEngine-f RewriteCond%{REQUEST_FILENAME}-重写规则/index.php[L]重写规则^about us\.html$http://www.example.com/ [R=301,L]#END WordPress
Hi,@jonathon你能帮我吗?对不起,我正在键入html作为hrml,我在htaccess中添加了下面的代码。你能检查我的代码吗?
#在RewriteBase/RewriteRule^index\.php$-[L]RewriteCond%{REQUEST_FILENAME}上启动WordPress RewriteEngine-f RewriteCond%{REQUEST_FILENAME}-重写规则/index.php[L]重写规则^about us\.html$http://www.example.com/ [R=301,L]#END WordPress
Hi,@jonathon你能帮我吗?对不起,我正在键入html作为hrml,我在htaccess中添加了下面的代码。你能检查我的代码吗?
#在RewriteBase/RewriteRule^index\.php$-[L]RewriteCond%{REQUEST_FILENAME}上启动WordPress RewriteEngine-f RewriteCond%{REQUEST_FILENAME}-重写规则/index.php[L]重写规则^about us\.html$http://www.example.com/ [R=301,L]#END WordPress
Hi,@jonathon你能帮我吗?对不起,我正在键入html作为hrml,我在htaccess中添加了下面的代码。你能检查我的代码吗?
#在RewriteBase/RewriteRule^index\.php$-[L]RewriteCond%{REQUEST_FILENAME}上启动WordPress RewriteEngine-f RewriteCond%{REQUEST_FILENAME}-重写规则/index.php[L]重写规则^about us\.html$http://www.example.com/ [R=301,L]#结束WordPress