简体   繁体   English

WordPress的htaccess的

[英]Wordpress htaccess

I have transferred an old "htm" site to wordpress and I need to redirect the old htm domains with "named anchors". 我已经将旧的“ htm”站点转移到了wordpress上,我需要使用“命名锚点”重定向旧的htm域。

I have successfully redirected the "htm" to "/". 我已成功将“ htm”重定向到“ /”。 Eg: "page.htm" ii redirecting to page/ 例如:“ page.htm” ii重定向到page /

However I need help redirecting "page#art" to "page/#art". 但是,我需要帮助将“ page#art”重定向到“ page /#art”。 What I have right now doesn't work in IE and Safari. 我现在拥有的东西在IE和Safari中不起作用。

Here is my current code" 这是我当前的代码”

Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*).htm$ $1/ [R=permanent,L] php_value max_execution_time 600 php_value memory_limit 256M 选项+ FollowSymLinks RewriteRule上的RewriteEngine ^(。*)。htm $ $ 1 / [R = permanent,L] php_value max_execution_time 600 php_value memory_limit 256M

BEGIN WordPress 开始WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

END WordPress 结束WordPress

domainname.org/page.htm redirects to domainname.org/page/ domainname.org/page.htm重定向到domainname.org/page/

and also: domainname.org/page.htm#art redirects to domainname.org/page/#art 并且:domainname.org/page.htm#art重定向到domainname.org/page/#art

I need help redirecting "page#art" to "page/#art". 我需要帮助将“ page#art”重定向到“ page /#art”。

You can't do this at the server. 您无法在服务器上执行此操作。 The #art is a page anchor which is used by the browser to position the view on the page. #art是页面定位#art ,浏览器使用它来将视图定位在页面上。 This isn't passed by the browser to the server, so this anchor info isn't available to the rewrite engine. 这不会被浏览器传递到服务器,因此该锚信息对重写引擎不可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM