redirect 301 и опенкарт

M
На сайте с 15.05.2013
Offline
97
1974

Помогите разобраться. Хочу сдедать редирект. Что бы пользователь который заходи на сайт www.msmr.com.ua попадал не на www.msmr.com.ua./index.php?route_=1/common/home а на msmr.com.ua

в 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]
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]

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.msmr.com.ua\.com$ [NC]
RewriteRule ^(.*)$ http://msmr.com.ua/$1 [R=301,L]



### 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

но не помогло, сайт теперь вообще не открывается

siv1987
На сайте с 02.04.2009
Offline
427
#1

Добавить после RewriteEngine On

А RewriteEngine должен быть один - первый.

M
На сайте с 15.05.2013
Offline
97
#2
siv1987:
Добавить после RewriteEngine On
А RewriteEngine должен быть один - первый.


***91;CODE***93;***91;QUOTE***93;# 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
# 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 ***91;L***93;
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base ***91;L***93;
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^(***91;^?***93;*) index.php?_route_=$1 ***91;L,QSA***93;

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.msmr.com.ua\.com$ ***91;NC***93;
RewriteRule ^(.*)$ http://msmr.com.ua/$1 ***91;R=301,L***93;



### 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***91;/QUOTE***93;***91;/CODE***93;

так все равно не работает

siv1987
На сайте с 02.04.2009
Offline
427
#3

masimar, Добавить после RewriteEngine On

А RewriteEngine должен быть один - первый.

Где у вас RewriteEngine и где он должен быть?

RewriteEngine - включает выключает реврайты. Как они будут работать, если он у вас в конце после всех правил? И домен у вас немного под другому написан, разве не видно?

M
На сайте с 15.05.2013
Offline
97
#4
siv1987:
masimar, Добавить после RewriteEngine On
А RewriteEngine должен быть один - первый.

Где у вас RewriteEngine и где он должен быть?
RewriteEngine - включает выключает реврайты. Как они будут работать, если он у вас в конце после всех правил? И домен у вас немного под другому написан, разве не видно?

Я извеняюсь за свою тупость, RewriteEngine On поставил вначало, домен изменил но все равно не работает..

не могли бы вы прописать правильный код?

спасибо за ранее!

---------- Добавлено 18.05.2013 в 17:02 ----------

сейчас я исправил так:

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

# SEO URL Settings
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteEngine On
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www.msmr\.com.ua$ [NC]
RewriteRule ^(.*)$ http://msmr.com.ua/$1 [R=301,L]
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap ***91;L***93;
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base ***91;L***93;
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^(***91;^?***93;*) index.php?_route_=$1 ***91;L,QSA***93;


### 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.

не работает

siv1987
На сайте с 02.04.2009
Offline
427
#5
masimar:
не работает

Во первых не не работает а ошибка сервера, а во вторых наверное видно, что в этом коде битые квадратные скобки.

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} =www.msmr.com.ua [NC]

RewriteRule ^(.*)$ http://msmr.com.ua/$1 [R=301,L]

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]

...остальные реврайты

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий