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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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
重定向旧永久链接(page_id=x)wordpress_Wordpress_Mod Rewrite_Permalinks - Fatal编程技术网

重定向旧永久链接(page_id=x)wordpress

重定向旧永久链接(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

我曾经有我的永久链接到标准格式,比如。现在我已经改变了这一点,在wp根文件夹的httpd.ini文件中使用ISAPI重写。这是可行的,但我需要将旧的页面_id=x样式的页面重定向到当前的永久链接,其形式为


我已经看了一些关键词等,但似乎没有什么真正起作用。我的页面数量非常有限,因此我指定所有页面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]
希望这对别人有帮助