2

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 to https://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 :(

2

You asked quite a few questions and I suspect you know most of the answers already. So to clear up some confusion, I will address the subject of changing the domain name since this sounds like the new question. If you need more, please let us know.

Keywords in domain names mean almost nothing anymore and exact matches rarely happen as a result. That was a mistake that Google quickly realized and reverted after only a fairly short period of time. It took about 2 years. What can I say, Google is a slow learner. It polluted the search pool with bad matches just because the domain name matched the search. It was a concept that failed miserably. I could have told them that had they asked. It was a no-brainer that domain monetizers would buy domain names for $1 or just use domain tasting and spam the snot out of the search engines. Even a blind man could see that one coming.

I would not change domain names expecting better search results. In fact, you will actually lose by changing domain names. You lose all the value you have made over the lifetime of your current domain name when you change. Yes- you can do 301 redirects and recapture some/most of the value, but that old domain name must remain with a 301 redirect for that to happen. Somewhere along the line you will want to drop the old domain and you will find that you have relied upon the 301 redirect as a crutch and had not built as much value in your new domain as you should have. Plus too many redirects, and Google may not follow.

Generally speaking, unless there is a critical reason to change domain names, it is a horrible idea to do so.

There is no such thing as changing domain names for SEO purposes. Build value in the domain name you have now which seems to be working well. My grandfather always said, "If ain't broke, don't fix it!" He said a few other things, but they don't allow them on this site.

[Update]

I think this will do what you want... of course change the example.com with your domain name.

RewriteEngine On

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^example\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

The firs line checks to see if the request is not already HTTPS, the next two capture all requests, the last line redirects to HTTPS. Of course if the rewrite engine is not turned on in the configuration, then the very first line is required to enable redirects.

Okay. I just looked at your .htaccess file. You can put the lines almost anywhere, but for the sake of continuity, I would put it under:

# Tentativa de prevenir erro headers sent
#RewriteCond %{HTTP_HOST} !^loja\.genesiseries\.com
#RewriteRule ^(.*)$ http://loja.genesiseries.com/$1 [R=301,L]

... since it follows the same vein. You do not need to put in RewriteEngine On since you are already doing redirects- obviously it is on. As well, just for future reference, you can add a comment starting with a # like this:

# this redirects example.com and www.example.com to https://example.com

... to refresh your memory when you have to look at it again.

For what it is worth, the Apache documentation is here: http://httpd.apache.org/docs/current/mod/mod_rewrite.html It will make you go cross-eyed, but eventually you will begin to understand it and find it really is not that hard. The next thing you want to know about is regular expressions and there are good links for that on the same page.

  • So it's not cool redirect the https to http, www. to without www. and redirect domain? as this way it will be 3 redirect, google may not follow? – Isleno Ituriel Nov 23 '14 at 18:01
  • @IslenoIturiel I know there is a limit, but I do not know what the limit is. It may work just fine, but I am a firm believer in using as few redirects as possible simply because it can cause problems elsewhere. – closetnoc Nov 23 '14 at 18:03
  • Do you know the best way to redirect by htaccess www to non-www and http to https? I don't know anything about redirect rules :\ – Isleno Ituriel Nov 23 '14 at 18:23
  • @IslenoIturiel I updated the answer. I think this is correct code for you. Try it and see what you get. – closetnoc Nov 23 '14 at 19:10
  • My htaccess have so many things I am lost, how to add the new rewriterule? can you please see my question again? I updated! I am afraid to edit and make a mistake – Isleno Ituriel Nov 23 '14 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.