oscommerce重定向多个 - 根到文件夹,文件夹到文件夹+ www到非www

时间:2013-12-22 10:53:37

标签: .htaccess redirect oscommerce

我正在尝试将多个情境重定向到位于文件夹中的oscommerce商店 没有www的mydomain.com/osc

请帮我重定向......

我的OSC安装在文件夹/ store /中 我希望所有domain.com或www.domain.com都重定向到domain.com/store 还永久重定向旧域文件夹/ shop / with或www to / store /

我已经尝试了但是出现了一个奇怪的问题,它适用于产品,但是当我访问www.domain.com/store/contact_us.php的信息页面时,它会重定向到domain.com/contact_us.php并给出404错误(当然没有)

这是我的root(domain.com)的.htaccess

RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ http://ambiancehome.ca/store/ [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^$ http://domain.com/store [R=301,L]

#additional redirect of a product which is moved/removed / changed
Redirect 301 /store/bed-loungers-c-21.html http://ambiancehome.ca/store/product_info.php/bed-lounge-back-rest-reading-pillow-p-104.html

这是/ store / folder

的.htaccess
Options +SymLinksIfOwnerMatch
<IfModule mod_rewrite.c>
RewriteEngine On

# RewriteBase instructions
# Change RewriteBase dependent on how your shop is accessed as below.
# http://www.mysite.com = RewriteBase /
# http://ambiancehome.ca/store/ = RewriteBase /store/
# http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/
# Change RewriteBase using the instructions above
RewriteBase /store/
RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,L,QSA]
# Articles contribution
RewriteRule ^([a-z0-9/-]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-au-([0-9]+).html$ articles.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA]
# Information pages
RewriteRule ^([a-z0-9/-]+)-i-([0-9]+).html$ information.php [NC,L,QSA]
# Links contribution
RewriteRule ^([a-z0-9/-]+)-links-([0-9_]+).html$ links.php [NC,L,QSA]
# Newsdesk contribution
RewriteRule ^([a-z0-9/-]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA]
</IfModule>

1 个答案:

答案 0 :(得分:0)

保持你的root .htaccess只是这样:

RewriteEngine on

RewriteRule ^$ /store/ [R=301,L]