SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2001
    Location
    usa
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mod_rewrite functionality alternative

    Ok, I have a particular hosting account with a company I wont name. The account is virtual, not dedicated, running on apache with most every module installed except for mod_rewrite. Since I get a dedicated ip, and more space than I need, I want to host more than one domain on the account using mod_rewrite based on the HTTP_HOST variable in a .htaccess file. Of course, the hosting company wants to charge me to set up redirect requests for a separate domain to a subdirectory, so when i ask about the mod_rewrite, they tell me they disable it for security reasons with no further explanation.

    Anyway, I want to find a substitute for mod_rewrite to accomplish the same task. The closest I can get is setting up the file not found handler(in the .htaccess file) to point to a PHP script that looks up the mime type of the requested file in a mySQL table as well as the directory associated with that domain, then include() that file or virtual() if it is a CGI script. This works alright, except for a couple problems. 1, search engines wont index anything b/c the server is still returning the 404 (file not found) header. I can fix this by adjusting the headers in the php script though. 2, CGI scripts that require POST variables dont get them. 3, there are mime types I dont know....specifically icons for the favicon.ico of IE4+. 4, i have to stay alert of security risks when being able to access files THROUGH a PHP script(for example, i PW protected an admin directory, only to later realize that the files could be accessed easily through the PHP system).

    I can get around all of that somehow im sure and use the PHP fix up. However, I was thinking there may be another way, and maybe you all knew it. My current investigations are looking at the 'action' commands for .htaccess files. Any ideas?

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is mod_alias enabled? You might be able to use this instead.

  3. #3
    SitePoint Member
    Join Date
    Jun 2001
    Location
    usa
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That it is, and I thought about that, but the only directives in mod_alias available to .htaccess files are the various forms of redirection. I dont want to change the url in the user's browser if at all possible. The alias directive (and relatives) are only available in server config and virtual host, which i dont have access to.

  4. #4
    SitePoint Zealot Tiger_Tom's Avatar
    Join Date
    Feb 2000
    Location
    U.K.
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Forgive my bluntness, but...

    You should change your web-host?

    It might be easier in the long run. If this mod-rewrite
    is standard in Apache, and they won't give it to you...

    Setting up and promoting a web site is hard enough work without having to fight the web-host as well.


Bookmarks

Posting Permissions

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