Results 1 to 3 of 3

Thread: htaccess URL masking

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2005
    Posts
    54

    htaccess URL masking

    Ok, a bit of longshot this one, but here goes...

    I have a site hosted on my web space account, for example www.somehosting.com/mysite/home.php. I also have a domain name that I want to use for the site, e.g. www.properdomain.com. At the moment properdomain.com points to www.somehosting.com/mysite/home.php

    What I need to do is mask it properly so that properdomain.com/ = somehosting.com/mysite/

    This is so that the links on my site are www.properdomain.com/links.php, etc, rather than www.somehosting.com/mysite/links.php.

    I've tried using htaccess but I can't quite do it. Well, I did it once using mod rewrite, setting up a rewrite condition for if the pages are accessed from www.properdomain.com...

    e.g. RewriteRule properdomain.com/.*$ http://www.somehosting.com/mysite/$1

    For a while this worked, and you could access my pages using either domain. Then it suddenly stopped, and the issue seems to be that if the webserver receives a request for www.properdomain.com/links.php, it sees the 'properdomain.com' but and automatically redirects to the homepage (where the domain is 'pointed' to in the domain name settings). In short, the htaccess seems to be ignored.

    Any ideas anyone?

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: htaccess URL masking

    if it worked for a while and stopped suddenly without you changing anything, you should talk to the host of your website and the host of your domain, and ask if they have done anything to prevent what you're doing.
    Like Archer? Check out some Sterling Archer quotes.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: htaccess URL masking

    You don't need a redirect for that, it's how domain names work anyway. Bind yourdomain.com to the IP of your server and then use your account control panel to locally bind that domain name to your account (this step varies per host and hosting account management software).

    BTW, "www" is a pointless abomination. Make sure your domain name also works without it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width