2012-11-01 63 views
1

对于我和我所有的多年的经验的.htaccess的生活,我不能让这个简单的重定向的工作......我完全难住了,因此任何帮助将是巨大的;301重定向到动态静态URL - Magento的

来源: http://www.offices-furniture.co.uk/pp?prod=fridgemaster-desk-fan.html

要: http://www.offices-furniture.co.uk/fridgemaster-desk-fan.html

应该是简单的,但没有哦~~ ..

我使用Magento的,自己的专用服务器,以充分获得一切

+0

我已经尝试使用: 重写规则^([^ /] *)$/PP PROD = $ 1 [L] 但在500服务器错误结果 也试过:RedirectMatch 301 ^第?PROD =(。*)\。HTM $ http://www.offices-furniture.co.uk/$1 –

回答

0

终于得到了这方面的一些底部时间过后。基本上Magento正在干扰htaccess文件,所以我在另一个网站上测试过;

http://www.office-desks.co.uk/solar-cantilever-combi-desks.html 实际上是从 http://www.office-desks.co.uk/cat/product.php?prod=solar-cantilever-combi-desks.html

加载结果现在我有干净的网址wohoo :)

这里是我的htaccess的代码,可以帮助别人;

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)\.html$ cat/product.php?prod=$1 

RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteCond %{SCRIPT_FILENAME} !-f 
RewriteRule ^(.*)\.php$ cat/cat.php?cat=$1 

RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteCond %{SCRIPT_FILENAME} !-f 
RewriteRule ^([^\.]+)$ cat/cat.php?cat=$1 

引起问题的magento中的行是这些(通配符);

RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteCond %{SCRIPT_FILENAME} !-f 
RewriteRule (.*) m1_seourls.router.php 

RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteCond %{SCRIPT_FILENAME} !-f 
RewriteRule (.*) m1_seourls.router.php 
0

http://www.mbstrategic.com/02/301-redirects-for-dynamic-urls-to-static-pages-with-htaccess/

301个重定向动态的URL静态页面与htaccess的

文章编号是htaccess的necesary,看看excel表格

+0

您好欧内斯特 - 我已经详细阅读了那篇文章。链接到excel下载是腐败的。谢谢 –

+0

对我来说,链接到Excel不是腐败。我使用openoffice –

+0

我刚刚对open office做了同样的事情并使用了该工具。然而,输出; RewriteCond%{QUERY_STRING}^prod = fridgemaster-desk-fan.html $ \t RewriteRule^pp $ http://www.offices-furniture.co.uk? [R = 301,L] 没有做所有 –