我一直在尝试将旧网站的旧网页重定向到永久重定向的相应新网页。 以及重定向www.example.com
到example.com
.htaccess去除www。 AND redirect
我不似乎能够在瞬间在同一时间
一举两得重定向从EX www.example.com/correctlink
正确的链接作品example.com/correctlink
但只有example.com/Info.aspx
被重定向到example.com/about-magento-demo-store
和不www.example.com/Info.aspx
*更新
我想删除WWW。并将40-50个具体地址重定向到新的特定地址。我的问题是,重定向只适用于谷歌保存旧链接没有Www。如果Google已经存储了包含www的链接。那么我的重定向重定向永久example.com/tabid/61/CategoryID/13/ProductID/64/Default.aspx /index.php/solpaneler/re不起作用 - *更新
我的htaccess看起来有点像这样 (与最终的几行是在存在之前,我开始编辑) (我也试着广告一行Redirect permanent http://www.example.com/Info.aspx http://example.com/about-magento-demo-store
但是它没有功能)
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://example.se/$1 [R=301,QSA,L]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule^http%2://%1%{REQUEST_URI} [L,R=301]
Redirect permanent /Info.aspx /about-magento-demo-store
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule .* index.php [L]
太棒了!但我有一个静态列表,其中包含特定链接,我想将它们重定向到特定页面。是否有可能通过静态链接制作大量重新编写的程序? –
你可以这样做。在apache出现性能问题之前,你需要大量的重写过程。所以保持简单。 – Gerben
像下面那样? RewriteCond http://ww.example.com/ProductID/64/Default.aspx rewriteRule http://example.com/index.php/solpaneler/default.html RewriteCond http://ww.example.com /ProductID/65/Default.aspx rewriteRule http://example.com/index.php/solpaneler2/default.html .............并继续像这样约50个链接。 ... 感觉静态变量很奇怪!? –