Post by Daniel.Vasian » Thu May 18, 2017 3:21 am

Hi All,

I have a little problem, my site had been installed using non-www url and i want to redirect all the customers that type www.mysite.com to the non-www address, in this exemple mysite.com. I searched the code on forum or internet, but i found only the code from non-www to www. If is possible please help me with the code, the site is ardentis.ro. Also could you please tell me if i can move the site from non-www to www after the installation? Thank you in advance for your support. Bellow we will find my htaccess code:

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# 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 /
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ http://yoursite.com/$1 [R=301,L]
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/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]

Newbie

Posts

Joined
Sun Apr 09, 2017 2:41 am

Post by uksitebuilder » Thu May 18, 2017 3:31 pm

I have edited your code above to redirect www to non-www

Please edit the domain name I put to suit your own.

User avatar
Guru Member

Posts

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

Post by michalfranek » Sun Mar 24, 2019 2:40 am

Hi, I have same problem with my web can anybody help me with this? i am desperate :crazy:

Newbie

Posts

Joined
Mon Jul 17, 2017 3:19 pm

Post by thekrotek » Sun Mar 24, 2019 2:52 am

michalfranek wrote:
Sun Mar 24, 2019 2:40 am
Hi, I have same problem with my web can anybody help me with this? i am desperate :crazy:
Oh, god! Just google for it!!! Tons and tons of solutions available.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: Amazon [Bot] and 8 guests