I figured that I'd ask this since I'm not entirely sure if .htaccess can do this.

Anywho, here's the scenario. I have a sponsor that wants "vanity URLs."

What they would like to do is measure the effectiveness of their marketing through different URLs that all point to the same page.

So...

http://www.somesite.com/venue1
http://www.somesite.com/venue2
http://www.somesite.com/specialpromo
etc.

would all take the user to the page:

http://www.somesite.com/original

I'm just wondering the "proper" way to go about this (since I'm not just redirecting from an old page to a new page). Ideally I would like to keep the URL that they entered in the address bar.

    Probably the easiest way to handle this would be to make symbolic links from the vanity directories to the actual directories. SSH into the server, cd into your web site's root directory and type:

    ln -s original venue1

    Then, in your PHP code, you can log the directory path and this will provide an idea of how much traffic each URL gets. (If you want to get fancy, you can even check the directory path and use that to customize the look of the site - or even offer special discounts and prices).

    When the user visits the directory /venue1, the URL bar will stay in venue1 for the whole session (links will work as long as you always use relative URL's in your HTML) so no .htaccess or site modification is necessary. In fact, if you did this with .htaccess rewrite rules, you might have trouble with determining which vanity URL they were using - and you might have trouble with making links work.

      5 days later

      Thanks for your reply. 🙂 I'm sure that would have been more than ideal. After much digging around though, it appears as if they don't even have SSH access for the site. Just plain old FTP and some access to some MySQL databases. Which is really less than ideal.

      Anyway, what I think I'll end up doing is more than a hack than anything. Just... creating these directories and having the original page as a PHP include. Kind of messy, but it should work.

        Personally, I would switch hosts. You can get good web hosting for under 8 bucks a month including PHP, MySQL and SSH - there's no need to put up with dumb limitations like that.

          Oh, I know. 🙂 If I were in their position, I'd switch hosts too. They're a non-profit organization though, and they're being hosted by a local company (with a long-standing relationship, and not entirely for free). So tech support is instantaneous and just a phone call away.

          Eventually I'd like them to move onto a dedicated server. Since... being on a shared server with their load sometimes is ridiculous. They're an annual event, so their web traffic sky-rockets with people buying online tickets and viewing program guides.

            Write a Reply...