slic535 Posted September 25, 2012 Share Posted September 25, 2012 i am using 5.1.4 and i need to redrect directknifesales.com to www.directknifesales.com. i have been reading on how google recognizes these as two different .coms and it doesnt sit well on the ranking scale. how do i redirect it to my www? Quote Link to comment Share on other sites More sharing options...
markscarts Posted September 25, 2012 Share Posted September 25, 2012 If you are on Apache server, you do this in the .htaccess file, search the web for more info, for instance see this link http://www.htaccessbasics.com/force-www-nonwww-domain/ Quote Link to comment Share on other sites More sharing options...
slic535 Posted September 25, 2012 Author Share Posted September 25, 2012 i tried some of that but it seemed to mess up the files in the htaccess. the files have been changed since the update and are different than what is commented on. i think the cubecart moderator would need to look into this for the new update of 5.1.4 and write a version specificaly for it. Quote Link to comment Share on other sites More sharing options...
markscarts Posted September 26, 2012 Share Posted September 26, 2012 I would be interested in knowing how it seems to "mess up the files in the htaccess". Can you paste the contents of your htaccess file here? Quote Link to comment Share on other sites More sharing options...
slic535 Posted September 28, 2012 Author Share Posted September 28, 2012 ## File Security <FilesMatch ".(htaccess)$"> Order Allow,Deny Deny from all </FilesMatch> #### Apache directory listing rules #### DirectoryIndex index.php index.htm index.html IndexIgnore * #### Rewrite rules for SEO functionality #### <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /~slic535/ ######## START v4 SEO URL BACKWARD COMPATIBILITY ######## RewriteCond %{QUERY_STRING} (.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule cat_([0-9]+)(.[a-z]{3,4})?(.*)$ index.php?_a=category&cat_id=$1&%1 [NC] RewriteCond %{QUERY_STRING} (.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule prod_([0-9]+)(.[a-z]{3,4})?$ index.php?_a=product&product_id=$1&%1 [NC] RewriteCond %{QUERY_STRING} (.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule info_([0-9]+)(.[a-z]{3,4})?$ index.php?_a=document&doc_id=$1&%1 [NC] RewriteCond %{QUERY_STRING} (.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule tell_([0-9]+)(.[a-z]{3,4})?$ index.php?_a=product&product_id=$1&%1 [NC] RewriteCond %{QUERY_STRING} (.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule _saleItems(.[a-z]+)?(?.*)?$ index.php?_a=saleitems&%1 [NC,L] ######## END v4 SEO URL BACKWARD COMPATIBILITY ######## RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA] </IfModule> <IfModule mod_suphp.c> suPHP_ConfigPath /home/slic535 <Files php.ini> order allow,deny deny from all </Files> </IfModule> Quote Link to comment Share on other sites More sharing options...
markscarts Posted September 28, 2012 Share Posted September 28, 2012 Thanks. Try adding this code: RewriteCond %{HTTP_HOST} !^www.directknifesales.* [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^(.*) http://www.directknifesales/$1 [L,R] just BETWEEN these lines of code: RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA] </IfModule> Quote Link to comment Share on other sites More sharing options...
slic535 Posted June 24, 2013 Author Share Posted June 24, 2013 I added the code to my website but it doesn't redirect it. it just says the page doesn't exist. now what? if you type in http://directknifesales.com it doesn't redirect to http://www.directknifesales.com Quote Link to comment Share on other sites More sharing options...
markscarts Posted June 29, 2013 Share Posted June 29, 2013 "Now what?" I would suggest speaking with webhost. There is more than one way to write this, and the webhost should know server and apache well, and should not mind helping you with this if they are any good with customer service. I have managed to redirect with .htaccess on many occasions, but am by no means an expert on this. I have used this code as well in htaccess if you want to try it. RewriteCond %{HTTP_HOST} ^mydomain.com [NC] RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L] It has to go somewhere after RewriteEngine On and before the FIRST </IfModule> Quote Link to comment Share on other sites More sharing options...
slic535 Posted June 25, 2014 Author Share Posted June 25, 2014 I have been trying to get my website to redirect directknifesales.com to www.directknifesales. I asked my webhost for help and they made the www.directknifesales.com a subdomain to directknifesales.com. is this the correct way or are they way off? they didn't do anything in the .htaccess file. it does redirect to www not but not sure if its in the correct way. I don't want my main page showing as a sub domain do I? I am using 5.2.12 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.