重定向旧永久链接(page_id=x)wordpress
我曾经有我的永久链接到标准格式,比如。现在我已经改变了这一点,在wp根文件夹的httpd.ini文件中使用ISAPI重写。这是可行的,但我需要将旧的页面_id=x样式的页面重定向到当前的永久链接,其形式为重定向旧永久链接(page_id=x)wordpress,wordpress,mod-rewrite,permalinks,Wordpress,Mod Rewrite,Permalinks,我曾经有我的永久链接到标准格式,比如。现在我已经改变了这一点,在wp根文件夹的httpd.ini文件中使用ISAPI重写。这是可行的,但我需要将旧的页面_id=x样式的页面重定向到当前的永久链接,其形式为 我已经看了一些关键词等,但似乎没有什么真正起作用。我的页面数量非常有限,因此我指定所有页面ID的列表并不是一个真正的问题。有人知道我怎么做吗?找到了。也许这不是书中最好的把戏,但下面是: RewriteRule /(.*)?page_id=3(.*) /company_profile [L,I
我已经看了一些关键词等,但似乎没有什么真正起作用。我的页面数量非常有限,因此我指定所有页面ID的列表并不是一个真正的问题。有人知道我怎么做吗?找到了。也许这不是书中最好的把戏,但下面是:
RewriteRule /(.*)?page_id=3(.*) /company_profile [L,I,RP]
我的完整httpd.ini文件现在是:
[ISAPI_Rewrite]
RewriteEngine On
RewriteBase /
RewriteCond ${REQUEST_FILENAME} !-f
RewriteCond ${REQUEST_FILENAME} !-d
# For special Wordpress folders (e.g. theme, admin, etc.)
RewriteRule /wp-(.*) /wp-$1 [L]
RewriteRule /google(.*) /google$1 [L]
#Rewrites for permanently moved pages (page_id=x):
RewriteRule /(.*)?page_id=3(.*) /company_profile [L,I,RP]
# For all Wordpress pages
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
希望这对别人有帮助 找到了。也许这不是书中最好的把戏,但下面是:
RewriteRule /(.*)?page_id=3(.*) /company_profile [L,I,RP]
我的完整httpd.ini文件现在是:
[ISAPI_Rewrite]
RewriteEngine On
RewriteBase /
RewriteCond ${REQUEST_FILENAME} !-f
RewriteCond ${REQUEST_FILENAME} !-d
# For special Wordpress folders (e.g. theme, admin, etc.)
RewriteRule /wp-(.*) /wp-$1 [L]
RewriteRule /google(.*) /google$1 [L]
#Rewrites for permanently moved pages (page_id=x):
RewriteRule /(.*)?page_id=3(.*) /company_profile [L,I,RP]
# For all Wordpress pages
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
希望这对别人有帮助