Post by florin_chiriac88 » Wed Apr 15, 2015 3:35 pm

hi,

Please help!


I got an issue regarding the website http://www.alexgamaimpex.ro

I've configured .htacces file so the non www version redirects to www version.
# redirect rules first
RewriteCond %{HTTP_HOST} ^alexgamaimpex.ro$ [NC]
RewriteRule ^(.*) http://www.alexgamaimpex.ro/$1 [R=301,L]

# then routing rules
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]

One of my problems now is that the cart function and compare function won't work anymore.

The second problem is that google indexed some of my pages in the non seo friendly url form (http://www.alexgamaimpex.ro/index.php?r ... duct_id=58 instead of http://www.alexgamaimpex.ro/Tevi/Tevi-s ... -p58c66c92 )

Hope you can help me!

If any details needed, please ask!


Thank you!


Posts

Joined
Wed Apr 15, 2015 3:16 pm

Post by gilaraujo » Sun Apr 19, 2015 6:50 pm

Try this instead:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

New member

Posts

Joined
Fri Mar 27, 2015 10:32 pm

Post by florin_chiriac88 » Fri Apr 24, 2015 6:40 pm

gilaraujo wrote:Try this instead:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]



Thank you for your response and sorry for taking me so long to respond.

I tried the piece of code you suggested and it didn't solve it.

I managed to figure out what the problem was. It seams it wasn't the .htacces file that caused the problem, it was my initial configuration of opencart instalation. When asked for the website url, i added the non www version instead of the www version.
For others having this problem, you have to go to your config.php file and add www. (or remove it if you use the non www version) in front of your website name.

That should do it!


Posts

Joined
Wed Apr 15, 2015 3:16 pm
Who is online

Users browsing this forum: Bing [Bot], o3445 and 17 guests