Post by kkdool » Sun Mar 04, 2012 10:43 pm

Hi,
I'm pretty new to OpenCart. Switched from VirtueMart & Joomla. Loving it.
One question, I have a SSL certificate but it requires all my URL's to have www. in them.
How can I make all URL's automatically redirect to www.?

Newbie

Posts

Joined
Sun Mar 04, 2012 10:41 pm

Post by victorj » Sun Mar 04, 2012 11:03 pm

edit your .htaccess

before the url rewrite code put the following lines

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

now all traffic comming from non www is redirected to www.

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Eigen productie en snelle levering.
https://123-deurrubbers.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by kkdool » Sun Mar 04, 2012 11:46 pm

Doesnt seem to work.
My .htaccess has a .txt extension. Would that affect it?

Newbie

Posts

Joined
Sun Mar 04, 2012 10:41 pm

Post by uksitebuilder » Mon Mar 05, 2012 3:07 am

yes - remove the .txt extension

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by kkdool » Mon Mar 05, 2012 3:58 am

Thank you. Redirect works but with a problem.
I can't access my admin panel.
My website now has no theme. Its just all links and images but no formatting at all.
Any ideas?

*EDIT* I managed to sort my theme problem by enabling SEO URL's. But I can't access my admin panel because it redirects to a www. url and kinda goes in a loop asking me to login. Anyway to fix?

Newbie

Posts

Joined
Sun Mar 04, 2012 10:41 pm

Post by victorj » Mon Mar 05, 2012 4:12 am

Make sure that all the absolute url's in the config files in the root and admin point to http://www.yourwebsite.com

both http and https

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Eigen productie en snelle levering.
https://123-deurrubbers.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by kkdool » Mon Mar 05, 2012 9:31 pm

Did that. Proble now is again with the template.

Newbie

Posts

Joined
Sun Mar 04, 2012 10:41 pm

Post by victorj » Wed Mar 07, 2012 4:25 am

did you remove the rewrite rule out of the .htaccess

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Eigen productie en snelle levering.
https://123-deurrubbers.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by tragetaschen » Tue May 14, 2013 5:49 pm

hi,

tried:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.yourwebsite.com/$1 [R=301,L]
but our oc-shop is in a folder /shop/.

so i tried:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.yourwebsite.de/shop/$1 [R=301,L]

and also

RewriteCond %{HTTP_HOST} ^yourwebsite.de/shop/$ [NC]
RewriteRule ^(.*) http://www.yourwebsite.de/shop/$1 [R=301,L]

but it's not working...

any help....?

regards

www.bag-stage.de


User avatar
New member

Posts

Joined
Tue Dec 04, 2012 10:57 pm
Location - Germany

Post by magazinbilka » Sat Jan 10, 2015 4:02 pm

I have the same problem - when I change .htaccess, the site have www prefix, but admin panel cant be opened. I've change the config files in root and admin directory, but nothings happened... Can anybody help?

Newbie

Posts

Joined
Tue Feb 18, 2014 2:22 am
Who is online

Users browsing this forum: Google [Bot] and 11 guests