pegasusdba Posted May 15, 2007 Share Posted May 15, 2007 Anyone have some insight as to whether it's better to reference your site by www.website.com or website.com? I think is should be consistent in the least. Ideas? TIA :-" Link to comment Share on other sites More sharing options...
♥FWR Media Posted May 15, 2007 Share Posted May 15, 2007 Use www. only because it's what people expect .. I use just domain.com for https Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 15, 2007 Share Posted May 15, 2007 It doesn't matter as long, as you mention, you are consistent. You should go a step farther and redirect the one to the other to avoid duplicate content situations. There is code here on the forums for doing that. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
pegasusdba Posted May 17, 2007 Author Share Posted May 17, 2007 Thanks guys. It took much more work than anticipated, but it's done. I'm at the root. It just feels right. The experience was another testament to the wisdom of making backups. :-" Link to comment Share on other sites More sharing options...
warrenerjm Posted May 18, 2007 Share Posted May 18, 2007 It doesn't matter as long, as you mention, you are consistent. You should go a step farther and redirect the one to the other to avoid duplicate content situations. There is code here on the forums for doing that. Jack Hi Jack :blush: I can't find it? Please could you point? Thanks. I think I need it because I noticed alot of my links were going to the non www, but I also had a few going to www. I now have told google to use www, added it to configure.php & submit links in www. I would like to get it all sorted as I do not want my site ratings to be split :( Julie Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 19, 2007 Share Posted May 19, 2007 Take a look here. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
warrenerjm Posted May 19, 2007 Share Posted May 19, 2007 Take a look here. Jack Thank you Jack. I'm sure I chase my own tail looking sometimes! This is my first edit of this file, so does this look right please. I know I will have to change mydomain, but assume you put it at the end with a line space before? # $Id: .htaccess,v 1.4 2001/04/22 20:30:03 dwatkins Exp $ # # This is used with Apache WebServers # The following blocks direct HTTP requests in this directory recursively # # For this to work, you must include the parameter 'Limit' to the AllowOverride configuration # # Example: # #<Directory "/usr/local/apache/htdocs"> # AllowOverride Limit # # 'All' with also work. (This configuration is in your apache/conf/httpd.conf file) # # This does not affect PHP include/require functions # # Example: http://server/catalog/includes/application_top.php will not work <Files *.php> Order Deny,Allow Deny from all </Files> # Eliminates www vs. non-www RewriteCond %{HTTP_HOST} ^mydomain\.com RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=permanent,L] Thank you for your time. Appreciate it. :thumbsup: Julie Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 19, 2007 Share Posted May 19, 2007 Yes, that look correct. Just do a quick test on your site to verify it. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
warrenerjm Posted May 19, 2007 Share Posted May 19, 2007 Yes, that look correct. Just do a quick test on your site to verify it. Jack Hi OK I saved it to inc/htaccess & typed in mysite without the www. It took me to the site but didn't change the address bar to read www.mysite. Is it suposed to? thanks Julie Link to comment Share on other sites More sharing options...
satish Posted May 19, 2007 Share Posted May 19, 2007 Yes htacess rewrite rule will not change url on browser its meant for server instructions internally. I suggest to use http:// www dot site dot com. Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does. Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 19, 2007 Share Posted May 19, 2007 Hi OK I saved it to inc/htaccess & typed in mysite without the www. It took me to the site but didn't change the address bar to read www.mysite. Is it suposed to? thanks Julie Add this before what you have (use www or not, depending on how you want it)#redirect index.php to root RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://www.yourdomain.com/ [R=301,L] Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
warrenerjm Posted May 19, 2007 Share Posted May 19, 2007 Add this before what you have (use www or not, depending on how you want it)#redirect index.php to root RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://www.yourdomain.com/ [R=301,L] Jack Hi Jack How does this look? mysite will change in 3 places. # $Id: .htaccess,v 1.4 2001/04/22 20:30:03 dwatkins Exp $ # # This is used with Apache WebServers # The following blocks direct HTTP requests in this directory recursively # # For this to work, you must include the parameter 'Limit' to the AllowOverride configuration # # Example: # #<Directory "/usr/local/apache/htdocs"> # AllowOverride Limit # # 'All' with also work. (This configuration is in your apache/conf/httpd.conf file) # # This does not affect PHP include/require functions # # Example: http://server/catalog/includes/application_top.php will not work <Files *.php> Order Deny,Allow Deny from all </Files> #redirect index.php to root RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://www.mysite.co.uk/ [R=301,L] # Eliminates www vs. non-www RewriteCond %{HTTP_HOST} ^mysite\.co.uk RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [R=permanent,L] OK This will change the index.php & categories address bar from non www to www, BUT if I type in mysite.co.uk it shows as mysite.co.uk This probably means something to you? :blink: I have home on my nav bar & not home>catalog> Should I look at this (trying to remember the file :blush: ) Thanks Julie Link to comment Share on other sites More sharing options...
warrenerjm Posted May 19, 2007 Share Posted May 19, 2007 In inc/lang/eng/english.php I have this: define('HEADER_TITLE_TOP', ''); define('HEADER_TITLE_CATALOG', 'Home'); Is this why I have "my" confusion? I got this from a thread agesssss ago, but it was so both front pages doesn't show. Something to do with SE seeing duplicate content for the www.mysite.co.uk & www.mysite.co.uk/index.php What do I need to do next please? Thanks Julie Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 20, 2007 Share Posted May 20, 2007 You should read through the thread I posted. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
warrenerjm Posted May 20, 2007 Share Posted May 20, 2007 You should read through the thread I posted. Jack Sorry Jack. Your link took me to page 4 so I didn't read 1-3 :blush: I'm off to do just that now :D Thanks Julie Link to comment Share on other sites More sharing options...
warrenerjm Posted May 20, 2007 Share Posted May 20, 2007 Sorry Jack. Your link took me to page 4 so I didn't read 1-3 :blush: I'm off to do just that now :D Thanks Julie Hi Jack OK please advise :D Do I do this contribution : Root install /index.php fix or this suggestion : Thread suggestion I do not have UltimateSEO. Would that make this not work? It doesn't help when I do not know what they are trying to technically achieve (I rely on learning & doing what the experienced say) & secondly there are lots of suggestions & add ons (which hurts my head! :P ) I respect your advise. Thanks Julie Link to comment Share on other sites More sharing options...
warrenerjm Posted May 20, 2007 Share Posted May 20, 2007 Hi Jack I went with the original suggestion in this thread. 1: added to inc/filenames.php define('FILENAME_HOME', '/'); 2: changed all FILENAME_DEFAULT to FILENAME_HOME at / level: allmanufacturers.php checkout_success.php conditions.php contact_us.php cookie_usage.php create_account_success.php down_for_maintenance.php login.php logoff.php my_points_help.php newsdesk_info.php newsdesk_search_results.php pollbooth.php privacy.php product_info.php redirect.php shipping.php shopping_cart.php ps I wasn't sure if I should do the index.php so haven't yet? I have extra ones than previously suggested, but some are for hte contributions I have added. 3: htaccess as above 4: changed FILENAME_DEFAULT to FILENAME_HOME in inc/application_top.php for breadcrumb. I tried the changes to the inc/functions/html_output.php but it didn't solve the // from the continue buttons or home link in the breadcrumb. Click on a category or manufacturer & it still has /index.php?... Is this right? If I type in mysite.co.uk I do not get directed to www.mysite.co.uk still. If I then click on a category it does change to www.mysite.co.uk As far as I can see I have done what was said in the thread but it isn't right. :'( Please could you help point me in the right direction. I can pm you my URL if you want/have the time to have a peek? Thanks Julie Link to comment Share on other sites More sharing options...
warrenerjm Posted May 20, 2007 Share Posted May 20, 2007 Hi... Sorry to be a pest! OK If I use the code in includes/functions/html_output.php if($page = '/') { if ($connection == 'NONSSL') { $link = HTTP_SERVER; } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = HTTPS_SERVER; } else { $link = HTTP_SERVER; } } else { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>'); } } else { if ($connection == 'NONSSL') { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; } else { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } } else { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>'); } } it resolves the // but my links in the information box goes to the same page & not the relevant information page? I have been staring at this all day & am nearly there but I don't know what to do next. My kids want to know when I'm going to come out of my room!! I must have been very naughty. :lol: Thanks Julie ps: to answer my own question...don't do the index.php it turns the page blank!! Link to comment Share on other sites More sharing options...
warrenerjm Posted May 20, 2007 Share Posted May 20, 2007 I don't know what to do now. I feel :'( I can't post on the other thread 'cos it's read only. I have searched for any information on this & come up with >_< I don't have Ultimate SEO. Can this be the problem? I am on an apache server & assume Mod rewrite is enabled 'cos when I click on a category it changes from non to www. It doesn't change it on the initial non www put in the browser. I have left the includes/functions/html_output.php as before as although this means I have www.mysite.co.uk// on the home & continue buttons I do have my information pages available. With the new code I have the correct www.mysite.co.uk/ but no information pages. The trouble is I can't leave i like this. I don't know what damage I am doing. PLEASE can anyone give me some suggestion? Thanks to header tags controller I have a PR of 4 on www.mysite.co.uk & PR of 3 on www.mysiye.co.uk/index.php I started this 'cos I wanted to not split the PR. If needs be I'll reverse it all 'cos I have no idea what damage I am doing leaving it like this. Thanks to all my help so far & to any I may get. :thumbsup: Julie Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 21, 2007 Share Posted May 21, 2007 I don't agree with the changes mentioned in the thread you posted (and the contribution seems to be related to it). Installing Ultimate SEO and making the changes mentioned in the thread I posted will fix most of the duplicate content problems. There may be a few others but they are simple changes instead of changing so much code like you did. Even if that code works, it changes standard code which will eventually cause you problems with other contributions, in my opinion. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
warrenerjm Posted May 21, 2007 Share Posted May 21, 2007 I don't agree with the changes mentioned in the thread you posted (and the contribution seems to be related to it). Installing Ultimate SEO and making the changes mentioned in the thread I posted will fix most of the duplicate content problems. There may be a few others but they are simple changes instead of changing so much code like you did. Even if that code works, it changes standard code which will eventually cause you problems with other contributions, in my opinion. Jack Hi Jack I gave it a go & failed!! so put it all back to before. :( A whole day wasted but still I did try. :P I still have the htaccess as you said, but that doesn't fix the index.php issue & only fixes the non www once you start clicking around the site. You can still come in on mysite.co.uk & it won't change it to www.mysite.co.uk I can't post on the other thread as it is a read only, but what do you think of the whole htaccess example given? I do not know what it all does, but do I need the whole of that code or just what I have? I have what I think are good PR but it is all split so I would really appreciate your sound advise on it. www.mysite.co.uk PR4 www.mysite.co.uk/index.php PR3 mysite.co.uk PR2 mysite.co.uk/index.php PR3 All I'm convinced down to your header tags controller. :thumbsup: Thanks Julie Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 21, 2007 Share Posted May 21, 2007 Adding the four lines of code to the .htaccess file (the two you found in the thread and the two I added) is all you need for the redirect. There are a few minor changes, as mentioned in the thread I posted, that will change some links to get rid of the index.php. After that, you should be all done. You do need to make those changes since, as you have found, your PR will be split. Plus, your pages may be placed in googles supplemental index for duplicate content. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
warrenerjm Posted May 21, 2007 Share Posted May 21, 2007 Adding the four lines of code to the .htaccess file (the two you found in the thread and the two I added) is all you need for the redirect. There are a few minor changes, as mentioned in the thread I posted, that will change some links to get rid of the index.php. After that, you should be all done. You do need to make those changes since, as you have found, your PR will be split. Plus, your pages may be placed in googles supplemental index for duplicate content. Jack Hi Jack I really appreciate you hanging in there for me. I have read the thread agin (believe me I will be able to quote it soon) Is this right please? Post 28 inc/functions/html_ouput.php change: if ($connection == 'NONSSL') { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; } else { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } } else { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>'); } to if($page == FILENAME_DEFAULT && $parameters=='') //traps all references to index.php made without any passed parameters like cPath, etc... { $page='/'; //Changes the path from 'index.php' to '/' if ($connection == 'NONSSL') { $link = HTTP_SERVER; } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = HTTPS_SERVER; } else { $link = HTTP_SERVER; } } else { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>'); } } else { if ($connection == 'NONSSL') { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; } else { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } } else { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>'); } } is this right as it was correcting his code (ie spaces) $page='/'; //Changes the path from 'index.php' to '/' Post 30 Includes/classes/breadcrumb.php change function add($title, $link = '') { $this->_trail[] = array('title' => $title, 'link' => $link); } to function add($title, $link = '') { if($link==FILENAME_DEFAULT){ $link=HTTP_SERVER."/"; } $this->_trail[] = array('title' => $title, 'link' => $link); } Post 33 # $Id: .htaccess,v 1.4 2001/04/22 20:30:03 dwatkins Exp $ # # This is used with Apache WebServers # The following blocks direct HTTP requests in this directory recursively # # For this to work, you must include the parameter 'Limit' to the AllowOverride configuration # # Example: # #<Directory "/usr/local/apache/htdocs"> # AllowOverride Limit # # 'All' with also work. (This configuration is in your apache/conf/httpd.conf file) # # This does not affect PHP include/require functions # # Example: http://server/catalog/includes/application_top.php will not work <Files *.php> Order Deny,Allow Deny from all </Files> <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} !^www\.mysite\.com RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://www.mysite.com/ [R=301,L] </IfModule> Spider.txt up to date robots.txt Is this what I should do? This is hard work! :lol: Thanks for your support. Julie Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 21, 2007 Share Posted May 21, 2007 You have to be careful when changing standard code as is recommended in some of the posts and contributions. They will break your shop or make it difficult to maintain in the future. Here is what I suggest: - if you don't have Ultimate SEO installed, install it. It will help your shop as is but it will also make it possible to remove the FILENAME_DEFAULT from some of the links. You can do the latter without it, but you would be losing a valuable change to the shop. - make the changes to the .htaccess file already mentioned - in includes/application_top.php, find all references to FILENAME_DEFAULT that are not part of a longer url and replace with '/'. There are strings in that file that have something like ...FILENAME_DEFAULT, 'cPath.... Don't change those. Only change where there is nothing attached to it like $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); Notice there is nothing after the FILENAME_DEFAULT. The above should be changed to $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link('/')); - in includes/header.php, do the same as the above. Usually there is only one such instance for the logo but your site might be different. - check in most of the files for the root, if there is a link to the home page (FILENAME_DEFAULT), change that. Again, don't change it if it is to somewhere else, even though FILENAME_DEFAULT is in the link. - the above should take care of all of the links on a standard site. If your shop has others, or maybe I missed some, they should be done to. If you have doubt as to whether a link should be changed or not, just click on it to see where it takes you. If it goes to http://yoursite.com/index.php, then it should be changed. If it goes to http://yoursite.com/index.phpXXX, where XXX is some additional code (other than a session ID), then it should not be changed. Hopefully the above will clear up any confusion. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
warrenerjm Posted May 21, 2007 Share Posted May 21, 2007 You have to be careful when changing standard code as is recommended in some of the posts and contributions. They will break your shop or make it difficult to maintain in the future. Here is what I suggest: - if you don't have Ultimate SEO installed, install it. It will help your shop as is but it will also make it possible to remove the FILENAME_DEFAULT from some of the links. You can do the latter without it, but you would be losing a valuable change to the shop. - make the changes to the .htaccess file already mentioned - in includes/application_top.php, find all references to FILENAME_DEFAULT that are not part of a longer url and replace with '/'. There are strings in that file that have something like ...FILENAME_DEFAULT, 'cPath.... Don't change those. Only change where there is nothing attached to it like $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); Notice there is nothing after the FILENAME_DEFAULT. The above should be changed to $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link('/')); - in includes/header.php, do the same as the above. Usually there is only one such instance for the logo but your site might be different. - check in most of the files for the root, if there is a link to the home page (FILENAME_DEFAULT), change that. Again, don't change it if it is to somewhere else, even though FILENAME_DEFAULT is in the link. - the above should take care of all of the links on a standard site. If your shop has others, or maybe I missed some, they should be done to. If you have doubt as to whether a link should be changed or not, just click on it to see where it takes you. If it goes to http://yoursite.com/index.php, then it should be changed. If it goes to http://yoursite.com/index.phpXXX, where XXX is some additional code (other than a session ID), then it should not be changed. Hopefully the above will clear up any confusion. Jack Hi Jack Hopefully the above will clear up any confusion.....errrrr :huh: sort of :P So all the files I changed in the root from (FILENAME_DEFAULT) to (FILENAME_HOME) and back again should be changed from (FILENAME_DEFAULT) to ('/') I think it was peter who mentioned this but I didn't understand what he was meaning. The same applies to the ones in application_top.php as explained above. .htaccess leave as you originally told me I don't have a link from the header & can't remeber seeing any instances in there. OH & install Ultimate SEO :o I don't understand the instructions! It looks really hard. If this is Hobsons Choice please could you tell me which of the many downloads I should install. Sometimes it is best to go back to the original authors contribution 'cos add ons create confusion & i'm easily confused. :rolleyes: Ultimate SEO (Chemo) Thanks hugely. Julie Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.