Link to home
Start Free TrialLog in
Avatar of Sean Rhudy
Sean RhudyFlag for United States of America

asked on

Redirect using HTACCESS file

We have a website that uses a CNAME record to point www to another host name.  It has to be done using a CNAME record because of the platform that it's before sent to.  There is no access to add folders or pages on that remote platform.  What we can customize is extremely limited.  Some marketing was done that used www.domain.com/myoffer.  But because we don't have access to add the /myoffer folder on the remote side, it doesn't go anywhere.  We do have access to our name server.  Would it be possible to use an .htaccess file accomplish the same thing the CNAME record is accomplishing but somehow make the www.domain.com/myoffer point to a local folder at our name server?  Or is their any other way to do this?
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

I don't think so.  ".htaccess" is a file used by the Apache web server and nothing else as far as I know.  http://www.htaccess-guide.com/
Avatar of noci
noci

.htaccess is needed to tell a browser to look into another place ( during preprocessing of a HTTP request) on apache.

If you have control over the www.domain.com name why not point it to aa server you DO control?
and there handle the /myoffer items.
Likely this is a bad idea, well, if you plan on using SEO at all.

If you have foo.com + www.foo.com that points to voodoo.com then you'll be implicitly commingling foo.com + voodoo.com content.

The complexities of trying to do this will create a situation where SEO debugging will be close to impossible.

Tip: Block all crawlers in case you every desire the site to have any SEO juice at all.

Tip: Trying to read through your question + truly figure out what your attempting to accomplish is difficult.

An attempt...

1) We have a website that uses a CNAME record to point www to another host name.

Super bad idea. This will destroy SEO + may cause some browsers to flag site as suspicious, because www + bare domain return different content.

www   IN   CNAME @

Open in new window


Best be the only www CNAME you ever use.

2) It has to be done using a CNAME record because of the platform that it's before sent to.  There is no access to add folders or pages on that remote platform.  What we can customize is extremely limited.

This makes zero sense because you say... platform that it's before sent to which suggests the target of the redirect.

3) Some marketing was done that used www.domain.com/myoffer.  But because we don't have access to add the /myoffer folder on the remote side, it doesn't go anywhere.

My suggestion is you hire someone to help you straighten all this out + change your hosting company to normal hosting, where you can change anything you like.

4) We do have access to our name server.

No. You'll do this via a 302. If you use 301s + anything's broken, the broken 301s will cache in visitor browsers creating a new layer of impossible to debug problems. Only use 302s for everything.

5) Would it be possible to use an .htaccess file accomplish the same thing the CNAME record...

No. CNAME records + 30X redirects are two different beasts.

Each should be used correctly, not trying to munge redirects using CNAME records.

6) is accomplishing but somehow make the www.domain.com/myoffer point to a local folder at our name server?

No.

CNAME != Redirect.

7) Or is their any other way to do this?

Setup normal DNS + normal Webserver level (302) redirects.
Avatar of Sean Rhudy

ASKER

Thank you for all of the input so far.  We don't have a choice about redirecting our www. and root domain to this other web host.  It's a platform that is required by corporate and we have absolutely no control over it.

The issue is that this company has spent hundreds of thousands of dollars on a marketing campaign that includes a URL to a page at www.ourdomain.com/myoffer.  Because the CNAME record is pointing our site to another host, we have no ability to create that folder and page.

According to corporate, it is important that however it gets forwarded, the site displays as www.ourdomain.com and not the URL of what it's redirecting too.

It sounds like it may be possible to remove the CNAME record and use 30X redirects?  I understand their may be damage to SEO efforts, but that's something I can tell them and let them decide on.
It may be that some of the terminology/language you're choosing may be slightly different than what precise terms may actually mean.

Tip: A lot of what your describing (if I understand what you're really saying) is simply impossible to accomplish.

Start by posting all your real URLs + likely someone can come up with a solution.
www.bsmfunding.com is the website

www.bsmfunding.com/myoffer is what we need to work and point to a different place than www.bsmfunding.com
ASKER CERTIFIED SOLUTION
Avatar of Sean Rhudy
Sean Rhudy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
And these are not mentioning your solution?
#a42798551 (Dave Baldwin)
#a42798573 (Noci)