Post by Jaap » Tue Apr 04, 2017 9:47 pm

Weet iemand wat de juiste code is om ervoor te zorgen dat https://www.domeinnaam.nl ook geredirect wordt met een 301 naar https://domeinnaam.nl

Lint Kopen https://lintenkopen.nl/


User avatar
Active Member

Posts

Joined
Fri Apr 15, 2011 12:10 am
Location - the Netherlands

Post by k2tec » Wed Apr 05, 2017 1:06 am

Code: Select all

# SEO URL Settings
RewriteEngine On

#SSL Port

# Remove www. from any domain query

# All broswer request get redirected to HTTPS
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

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

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

https://4easyhosting.com


User avatar
Active Member

Posts

Joined
Mon Apr 12, 2010 8:06 pm


Post by Jaap » Thu Apr 06, 2017 3:34 am

Bedankt voor je reactie.

Het werkt echter niet.
Heb mijn URL ingevuld waar mijndomein in de code staat.
En mijn .htaccess met de gehele code aangevuld.
maar de www is nog steeds bereikbaar.


Nu heb ik diverse "oplossingen" geprobeerd, maar nog niet de juiste gevonden.

Lint Kopen https://lintenkopen.nl/


User avatar
Active Member

Posts

Joined
Fri Apr 15, 2011 12:10 am
Location - the Netherlands

Post by artcore » Thu Apr 06, 2017 4:52 am

Code: Select all

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*) https://domein.nl%{REQUEST_URI} [R=301,L,NE]
RewriteBase /
Deze doet www OF non-ssl naar non-www+ssl
Let ook op de plaatsing; boven RewriteBase en onder RewriteEngine On
Hieronder komt de rest vd opencart htaccess regels

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: I moved on to Laravel ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by Jaap » Thu Apr 06, 2017 3:05 pm

Dat werkt bijna overal prima.
Behalve als ik de homepage oproep, daar is de www versie nog steeds beschikbaar.

Lint Kopen https://lintenkopen.nl/


User avatar
Active Member

Posts

Joined
Fri Apr 15, 2011 12:10 am
Location - the Netherlands

Post by k2tec » Thu Apr 06, 2017 3:44 pm

Heb je de config files wel juist staan.
Al mijn site verwijzen met mijn code naar https en zonder www.

https://4easyhosting.com


User avatar
Active Member

Posts

Joined
Mon Apr 12, 2010 8:06 pm


Post by Jaap » Fri Apr 07, 2017 1:04 am

Had inderdaad iets fout gedaan, werkt perfect!

Wederom dank.

Lint Kopen https://lintenkopen.nl/


User avatar
Active Member

Posts

Joined
Fri Apr 15, 2011 12:10 am
Location - the Netherlands
Who is online

Users browsing this forum: No registered users and 4 guests