.htaccess oscommerce将多个根目录重定向到文件夹,文件夹重定向到文件夹+;www到非www

.htaccess oscommerce将多个根目录重定向到文件夹,文件夹重定向到文件夹+;www到非www,.htaccess,redirect,oscommerce,.htaccess,Redirect,Oscommerce,我正在尝试将多个情况重定向到位于文件夹中的我的oscommerce存储 mydomain.com/osc不含www 请帮我重定向 我的OSC安装在文件夹/存储中/ 我希望所有domain.com或www.domain.com重定向到domain.com/store 也可以将旧域文件夹/shop/with或www永久重定向到/store/ 我试过了,但出现了一个奇怪的问题,它对产品很有效,但当我使用www.domain.com/store/contact_us.php访问信息页面时,它会重定向到d

我正在尝试将多个情况重定向到位于文件夹中的我的oscommerce存储 mydomain.com/osc不含www

请帮我重定向

我的OSC安装在文件夹/存储中/ 我希望所有domain.com或www.domain.com重定向到domain.com/store 也可以将旧域文件夹/shop/with或www永久重定向到/store/

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

这是我的根目录(domain.com)的.htaccess

这里是.htaccess/store/folder

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>
选项+符号链接所有者匹配
重新启动发动机
#重写基本指令
#根据您的店铺访问方式进行更改,如下所示。
# http://www.mysite.com =重写基/
# http://ambiancehome.ca/store/ =基础/存储/
# http://www.mysite.com/catalog/shop/ =基础/目录/车间/
#使用上述说明更改基础
新基地/商店/
重写规则^([a-z0-9/-]+)-p-([0-9]+).html$product_info.php[NC,L,QSA]
重写规则^([a-z0-9/-]+)-c-([0-9+).html$index.php[NC,L,QSA]
重写规则^([a-z0-9/-]+)-m-([0-9]+).html$index.php[NC,L,QSA]
重写规则^([a-z0-9/-]+)-pi-([0-9]+).html$popup_image.php[NC,L,QSA]
重写规则^([a-z0-9/-]+)-pr-([0-9]+).html$product_reviews.php[NC,L,QSA]
重写规则^([a-z0-9/-]+)-pri-([0-9]+).html$product\u reviews\u info.php[NC,L,QSA]
#文章贡献
重写规则^([a-z0-9/-]+)-t-([0-9+).html$articles.php[NC,L,QSA]
重写规则^([a-z0-9/-]+)-au-([0-9]+).html$articles.php[NC,L,QSA]
重写规则^([a-z0-9/-]+)-a-([0-9]+).html$article_info.php[NC,L,QSA]
#信息页
重写规则^([a-z0-9/-]+)-i-([0-9]+).html$information.php[NC,L,QSA]
#链接贡献
重写规则^([a-z0-9/-]+)-links-([0-9+).html$links.php[NC,L,QSA]
#新闻台稿件
重写规则^([a-z0-9/-]+)-n-([0-9]+).html$newsdesk_info.php[NC,L,QSA]
重写规则^([a-z0-9/-]+)-nc-([0-9]+).html$newsdesk_index.php[nc,L,QSA]
重写规则^([a-z0-9/-]+)-nri-([0-9]+).html$newsdesk_reviews_info.php[NC,L,QSA]
重写规则^([a-z0-9/-]+)-nra-([0-9]+).html$newsdesk_reviews_article.php[NC,L,QSA]

保留您的root.htaccess,只需像这样:

RewriteEngine on

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

因为在使用了这个之后,我仍然能够直接访问www.domain.com/store/I,在您的问题中,我没有看到阻止直接访问/store url的要求。如果您在问题中明确说明了所有这些要求,那么我可以相应地编辑我的答案。您在问题中写道:
我的OSC安装在文件夹/存储中/I希望所有domain.com或www.domain.com重定向到domain.com/store,也可以永久重定向旧域文件夹/shop/with或www到/store/
,此后我没有这样做请理解您的评论,
我仍然可以直接访问www.domain.com/store/
RewriteEngine on

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