I have a eCommerce based on OpenCart, but I was wondering about change my domain name for SEO purposes.
For me the critical thing about my changes are the imminent possibility of domain change, I'm freaking about damage my SEO and Google search position. Please take this into your answer. I really need help to do not make a mistake.
The actual name put me on first page and 3 or 4 position. The new name have the exactly keyword most searched by visitors and probably i will get the first place.
As my SSL was expired I installed new one and the user @MarekAndreansky give me a hint (on my last question Cheap Positive SSL worths?): I need redirect by 301 the www to take off the duplicate content.
Today I use: shop.example.com
(subdomain) and appears on Google like that but it's still accessible by www.shop.example.com
That is the first change I need do, the next is about my SSL. I need that all access by http://shop.example.com
redirect to https://shop.example.com
.
Things to do:
How to do correctly that redirect in .htaccess and take off the duplicate content? I have found the .htaccess code change to DOMAINS name (not subdomain).
How to do correctly redirect all users that access
shop.example.com
by http tohttps://shop.example.com
?
I want do it to spend more confidence, but if this can damage my ranking on Google I prefer forget it.
And about the domain name change in next 10 days I will decide.
UPDATE:
My domain: loja.genesiseries.com I will remove domain soon, so please MODS don't remove please!
My 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]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ http://loja.genesiseries.com? [R=301,L]
# Tentativa de prevenir erro headers sent
#RewriteCond %{HTTP_HOST} !^loja\.genesiseries\.com
#RewriteRule ^(.*)$ http://loja.genesiseries.com/$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
<FilesMatch ^config.php$>
Deny from all
</FilesMatch>
## INCREASE PAGE SPEED HTACCESS MODIFICATION ##
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
<ifModule mod_headers.c>
Header append Vary User-Agent
</ifModule>
## END INCREASE PAGE SPEED HTACCESS MODIFICATION ##
[UPDATE]
Now added to htaccess:
# this redirects example.com and www.example.com to https - thanks closetnoc @webmasters- stackexange
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} ^loja\.genesiseries\.com$ [NC, OR]
RewriteCond %{HTTP_HOST} ^www\.loja\.genesiseries\.com$ [NC, OR]
RewriteRule ^(.*)$ https://loja.genesiseries.com/$1 [R=301,L]
Still give error 500, as you said i add the dot and cross bar Something still wrong? There may be conflict with other rules?
[UPDATE 2] Below the apache error log
[Mon Nov 24 02:02:42 2014] [error] [client 58.37.14.114] /opt/php54/bin/php-cgi: /usr/lib64/libxml2.so.2: no version information available (required by /opt/xslt/lib/libxslt.so.1)
[Mon Nov 24 02:02:42 2014] [error] [client 58.37.14.114] /opt/php54/bin/php-cgi: /usr/lib64/libxml2.so.2: no version information available (required by /opt/xslt/lib/libxslt.so.1)
[Mon Nov 24 02:02:42 2014] [error] [client 58.37.14.114] /opt/php54/bin/php-cgi: /usr/lib64/libxml2.so.2: no version information available (required by /opt/xslt/lib/libxslt.so.1)
[Mon Nov 24 02:03:54 2014] [alert] [client 189.25.157.94] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters, referer: http://loja.genesiseries.com/tablet-genesis-gt-7325
[Mon Nov 24 02:03:54 2014] [alert] [client 189.25.157.94] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters, referer: http://loja.genesiseries.com/tablet-genesis-gt-7325
[Mon Nov 24 02:03:59 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:03:59 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:01 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:01 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:01 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:01 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:01 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:01 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:01 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:01 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:02 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:02 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:02 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:02 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:03 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:04 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:04 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:04 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
[Mon Nov 24 02:04:04 2014] [alert] [client 177.180.245.74] /home/genesise/public_html/loja/.htaccess: RewriteCond: bad flag delimiters
What you suggest now? I think that less times we use redirect is the best way, how optimize this htaccess? Some redirects above was to assign a friendly URL
UPDATE 3
New HTACCESS
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]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ https://loja.genesiseries.com? [R=301,L]
# Tentativa de prevenir erro headers sent
#RewriteCond %{HTTP_HOST} !^loja\.genesiseries\.com
#RewriteRule ^(.*)$ http://loja.genesiseries.com/$1 [R=301,L]
# this redirects example.com and www.example.com to https - thanks closetnoc @webmasters- stackexange
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^loja\.genesiseries\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.loja\.genesiseries\.com$ [NC]
RewriteRule ^(.*)$ https://loja.genesiseries.com/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.loja\.genesiseries\.com$ [NC]
RewriteRule ^(.*)$ https://loja.genesiseries.com/$1 [R=301,L]
Still with the problem with friendly URL, i'm feeling that we are so close :(