Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HELP! .htaccess Redirect Question


McCambletron

Recommended Posts

Hey guys,

 

This isn't specifically an osC question, but I hope someone can help me anyway...

 

I'm trying to redirect all traffic from "http://www.ocdepot.com" or "http://ocdepot.com" TO

my store at http://www.ocdepot.com/oscom/ --- but NOT redirect requests for other files and directories on my website.

 

I ONLY want the actual domain name to redirect here.

So if I were to try and access ocdepot.com/art/index.htm, I DO NOT want it to redirect to ocdepot.com/oscom/art/index.htm

 

Right now, you can see the problem I'm having by trying to go here: http://www.ocdepot.com/art/CommonLinks/CommonLinks.html

 

There's some kind of loop error when it tries to handle anything besides just the domain name.

 

 

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ocdepot\.com [NC]
RewriteRule (.*) [url="http://www.ocdepot.com/oscom$1"]http://www.ocdepot.com/oscom$1[/url] [R=301] 

 

www.ocdepot.com redirects great... but www.ocdepot.com/art/ causes problems.

 

HELP!

Link to comment
Share on other sites

I think the header redirect would not be too much of an issue for just the home page, especially if you do it as a 301.

 

Or how about this?:

 

RewriteCond %{HTTP_HOST} ^(www.)?ocdepot.com$
RewriteRule ^(/)?$ oscom/ [L]

 

 

Joe.

Joe

 

MacMan strikes again!

 

Always backup first before listening to me!

Link to comment
Share on other sites

I think the header redirect would not be too much of an issue for just the home page, especially if you do it as a 301.

 

Or how about this?:

 

RewriteCond %{HTTP_HOST} ^(www.)?ocdepot.com$
RewriteRule ^(/)?$ oscom/ [L]

 

 

Joe.

Hey, I actually think that's working! Thanks!

 

If I end up having any trouble with it I'll try a header redirect --I could have sworn I read they weren't good for SEO to your entry page, but I'll give one a shot if I have to.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...