0

我目前在我正在构建的新站点上的 .htaccess 文件中使用这种格式进行 301 重定向:

RewriteRule ^Default.asp$ http://www.example.com/index.php [R=301]

我需要一个基本上重定向http://www.example.com/blog/index.php/path-to-the-post/到的重定向http://www.example.com/blog/path-to-the-post/

我需要删除index.php第一个 URL 中的 ,同时保持帖子的实际路径相同。帮助?

4

2 回答 2

0

你应该试试RewriteRule ^blog/index.php/(.+)$ blog/$1 [R=301]

于 2012-04-19T20:43:42.587 回答
0

万一其他人遇到这个问题,这是对我有用的答案:

.htaccess博客的文件中,

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
于 2013-03-20T16:16:34.347 回答