我安装了SocialEngine以替换旧的CMS。问题在于搜索引擎中存在很多旧的URL。我想将它们重定向到当前网站上的相应网址(因为目前它们只能重定向到首页)。SocialEngine - 301重定向旧网站页面.htaccess
我的旧CMS的所有内容都被导入到SE中,因此每个旧页面现在都有相同的内容。 例如: 旧地址:/index.php?mod=news & AC =住客评论& ID = 367个 新地址:/用品/ 367
我想在我的.htaccess像添加:
redirectmatch 301 index.php?mod=news&ac=commentaires&id=([0-9]+) http://www.nailissima.fr/articles/$1
但它不起作用。当我输入旧地址时,它仍然会重定向到主页,而不是相应的文章。
你能帮我解决吗?
这里是我的.htaccess:
# $Id: .htaccess 7539 2010-10-04 04:41:38Z john $
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Get rid of index.php
RewriteCond %{REQUEST_URI} /index\.php
RewriteRule (.*) index.php?rewrite=2 [L,QSA]
# Rewrite all directory-looking urls
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*) index.php?rewrite=1 [L,QSA]
# Try to route missing files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} public\/ [OR]
RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$
RewriteRule . - [L]
# If the file doesn't exist, rewrite to index
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]
</IfModule>
# sends requests /index.php/path/to/module/ to "index.php"
# AcceptPathInfo On
# @todo This may not be effective in some cases
FileETag Size
预先感谢您!
致以问候
你可以发布你编辑的htaccess你添加规则的地方吗? – Salman