Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Use website.com or www.website.com?


pegasusdba

Recommended Posts

Hi Jack,

I added the two things you have in your htaccess file into mine (which I've posted here). It's not working properly so I think there is some code I need to change somewhere. What happens now is all my pages go to the index when I include the non-www redirect. In the thread I saw that you recommended Ultimate SEO a lot which I have installed already. There is a bunch of code the person you were helping kept adding and it seems like you told her to take it out. Can you please tell me what code change is needed? Thanks a lot for your direction I really appreciate it!

 

I have a catalog folder named products that holds my store. My htaccess file is in that folder and I added these rules to the rules there already.

 

#redirect non-www to www

RewriteCond %{HTTP_HOST} ^shedsforlessdirect\.com

RewriteRule ^(.*)$ http://www.shedsforlessdirect.com/products/$1

[R=permanent,L]

 

#redirect index.php to root

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/

RewriteRule ^index\.php$ http://www.shedsforlessdirect.com/products/

[R=301,L]

 

Another thing that might be affecting is in my root folder, since my store is in a catalog folder, I have another htaccess file which permanently redirects to the catalog:

RedirectMatch permanent ^/$ http://www.shedsforlessdirect.com/products/

 

Is this causing a conflict? Is there more code I'm missing? Thank you!

Link to comment
Share on other sites

  • 4 months later...
  • Replies 51
  • Created
  • Last Reply

Hi

Bundle of thanks. I have read the thread in detail and implemented code in html_output.php and it worked great for me.

 

Please refer to the thread below:

http://www.oscommerce.com/forums/index.php?sho...rt=#entry847460

 

<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>

 

Now as you said in the thread, I want to redirect all traffic coming to existing http://fashno.com to http://www.fashno.com instead so SE will not consider duplication and you have give this code. Please guide where to put this code (filename) and place to place in which file?

 

Regards

Tahir

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...