2013-08-20 34 views
0

我知道有類似的問題,但無法解決我遇到的問題。Opencart .htaccess配置問題

我正在使用Opencart 1.5.5.1。我們最近更新了網站,所以所有的鏈接都完全不同,所以我有301重定向了大量的鏈接。問題是,他們不工作。

這是我的.htaccess文件看起來像:

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 
# 2. In your opencart directory rename htaccess.txt to .htaccess. 
# For any support issues please visit: http://www.opencart.com 

Options +FollowSymlinks 

# Prevent Directoy listing 
Options -Indexes 

# Prevent Direct Access to files 
<FilesMatch "\.(tpl|ini|log)"> 
Order deny,allow 
Deny from all 
</FilesMatch> 

# SEO URL Settings 
RewriteEngine On 
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie./becomes /shop/ 

RewriteBase/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] 
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] 
RewriteRule ^download/(.*) /index.php?route=error/not_found [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) 
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] 

### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it. 
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that. 

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it: 
# php_flag register_globals off 

# 2. If your cart has magic quotes enabled, This may work to disable it: 
# php_flag magic_quotes_gpc Off 

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try 
# php_value upload_max_filesize 999M 

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields 
# php_value post_max_size 999M 

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields 
# php_value max_execution_time 200 

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields 
# php_value max_input_time 200 

# 7. disable open_basedir limitations 
# php_admin_value open_basedir none 

RewriteRule ^downloads.asp$ http://www.example.com/downloads [R=301,L] 

#301 redirect 
Redirect 301 /onlinestore http://mywebsite.com.au 
Redirect 301 /gallery.html http://mywebsite.com.au 
Redirect 301 /Images/getaflatstomachoct2012.pdf http://mywebsite.com.au 
Redirect 301 /onlinestore/all-products/allvia-melatonin-3-cream-57g http://mywebsite.com.au 
Redirect 301 /aboutus.html http://mywebsite.com.au/about_us 
Redirect 301 /meetus.html http://mywebsite.com.au/about_us 
Redirect 301 /mission.html http://mywebsite.com.au/about_us 
Redirect 301 /articleselectprotein.html http://mywebsite.com.au/blogs 
Redirect 301 /enewsletters.html http://mywebsite.com.au/blogs 
Redirect 301 /enewsletters/april2013/april2013.html http://mywebsite.com.au/blogs 
Redirect 301 /enewsletters/june2010/enewsletterjune2010.html http://mywebsite.com.au/blogs 
Redirect 301 /enewsletters/june2013/june2013.html http://mywebsite.com.au/blogs 
Redirect 301 /enewsletters/october2012/october2012.html http://mywebsite.com.au/blogs 
Redirect 301 /proteintablelarge.html http://mywebsite.com.au/blogs 
Redirect 301 /enewsletters/november2011/november2011.html http://mywebsite.com.au/blogs/christmas-survival-guide.html 
Redirect 301 /enewsletters/march2011/march2011.html http://mywebsite.com.au/blogs/digestion-boost-energy-recover-better-be-happier.html 
Redirect 301 /enewsletters/february2011/february2011.html http://mywebsite.com.au/blogs/fat-loss-during-your-lunch-break.html 
Redirect 301 /enewsletters/june2012/june2012.html http://mywebsite.com.au/blogs/living-healthier-by-alkalising-your-body-what-it-means-and-how-to-achieve-it..html 
Redirect 301 /enewsletters/august2010/enewsletteraugust2010.html http://mywebsite.com.au/blogs/marathon-triathlon-and-endurance-supplementation-guide.html 
Redirect 301 /articletop10fattips.html http://mywebsite.com.au/blogs/psn-s-top-10-fat-loss-tips.html 
Redirect 301 /enewsletters/september2010/enewsletterseptember2010.html http://mywebsite.com.au/blogs/psn-s-top-10-fat-loss-tips.html 
Redirect 301 /enewsletters/march2012/march2012.html http://mywebsite.com.au/blogs/q-a-we-answer-frequently-asked-questions.html 
Redirect 301 /enewsletters/may2012/may2012.html http://mywebsite.com.au/blogs/supplement-packs-for-your-goal.html 
Redirect 301 /enewsletters/november2010/enewsletternovember2010.html http://mywebsite.com.au/blogs/supplement-packs-for-your-goal.html 
Redirect 301 /enewsletters/july2011/july2011.html http://mywebsite.com.au/blogs/zma-better-sleep-sex-recovery-and-more.html 
Redirect 301 /contactus.html http://mywebsite.com.au/contact 
Redirect 301 /maplarge.pdf http://mywebsite.com.au/contact 
Redirect 301 /benefits.html http://mywebsite.com.au/membership-terms-and-conditions.html 
Redirect 301 /memberform.html http://mywebsite.com.au/membership-terms-and-conditions.html 
Redirect 301 /terms.html http://mywebsite.com.au/membership-terms-and-conditions.html 
Redirect 301 /onlinestore/accessories-1/all-accessories?page=1 http://mywebsite.com.au/accessories 
Redirect 301 /onlinestore/accessories-1/all-accessories?page=2 http://mywebsite.com.au/accessories 
Redirect 301 /onlinestore/accessories-1/all-accessories?page=3 http://mywebsite.com.au/accessories 
Redirect 301 /onlinestore/accessories-1/all-accessories?page=4 http://mywebsite.com.au/accessories 
Redirect 301 /onlinestore/accessories-1/all-accessories/advanced-fitness-manta-ray http://mywebsite.com.au/accessories 

重定向繼續。所以,問題是:

- 當你去原文地址: http://www.mywebsite.com.au/onlinestore/accessories-1/all-accessories/advanced-fitness-manta-ray

- 它應該重定向到這裏: http://mywebsite.com.au/accessories

- 但它放在這裏: 路線= onlinestore /配件1/all-accessories/advanced-fitness-manta-ray「> http://mywebsite.com.au/accessories-1/all-accessories/advanced-fitness-manta-ray?route = onlinestore/accessories-1 /所有配件/高級健身蝠012

所以問題是,它進入正確的新網站,但接着添加路線 =後跟原始網址。

我試圖獲得支持,但沒有成功。如果我能得到任何支持,我將非常感激。

問候, 海倫

回答

0

您需要將您的所有重定向命令的RewriteEngine On前行,否則他們將不會得到執行