.htaccess

topic posted Wed, October 13, 2004 - 12:38 PM by  Joseph
Hi everyone. I got a shared hosting account with www.websitesource.net and was wondering if there is a way to set up user directories using a .htaccess file?

Basicly want to set it so that if a user goes to

www.digitalindreams.com/Thargor/

it would actully return what was loacted at

www.digitalindreams.com/users/...c_html/

Replacing Thargor of course with what ever the user name was. Thargor just happens to be the user name I use at the site I'm chat community site I'm creating.

Thanks
posted by:
Joseph
New Hampshire
  • Unsu...
     

    Re: .htaccess

    Wed, October 13, 2004 - 3:55 PM
    In a shared hosting scenario you cant really utilize mod_userdir.

    What you can do is use use mod_rewrite or forcetype directives.
    • Re: .htaccess

      Wed, October 13, 2004 - 5:10 PM
      Could you give me an example..I'm afraid I'm not much good with configuration files, and this the first time I've actully done this.
      • Unsu...
         

        Re: .htaccess

        Wed, October 13, 2004 - 5:21 PM
        Hell i'd have to look it up and remember myself.

        Try the apache docs on apache.org for now.

        In the next few days if you still havent figured it out and i have time - i'll see what i can do.
        • Re: .htaccess

          Sat, October 16, 2004 - 4:34 PM
          I've tried a few diffrent things, but can't even seem to get my test server..a copy of Apache that I have installed on my Windows XP computer to work with .htaccess files. Currently there is no rush however. But if you got time and can give me an idea on at least some kinda of workaround that will give a userdirectory type set up I'd appreciate the time you'd put into it greatly.
          • Re: .htaccess

            Mon, October 18, 2004 - 9:07 AM
            From the Apache manual (httpd.apache.org/docs-2.0/...ing.html):

            "Apache is configured by placing directives in plain text configuration files. The main configuration file is usually called httpd.conf."

            "The server administrator further controls what directives may be placed in .htaccess files by configuring the AllowOverride directive in the main configuration files."

            AllowOverride
            httpd.apache.org/docs-2.0/...owoverride

            Basically, to turn on functionality in the .htaccess files, the server admin changes the httpd.conf to allow specific kinds of activity. Basic web security 101.

            Additionally, mod_rewrite is not available on all Apache web servers. You should check with your hosting provider to see what they will and will not allow you to do.
            • Re: .htaccess

              Mon, October 18, 2004 - 12:34 PM
              well damn..thats why I couldn't get it to even use the file on my test server. Its working now though, so thanks guys for what info you did provide. I've figured it out. This is the line I ended up adding

              RewriteRule ^\~([A-Za-z0-9]*)\/?(.*) digitalindreams.com/users/$1\/public_html\/$2

              http://www. actully proceded digitalindreams but took it out to provent it from becoming a link..anyone know if you can just disable the automatic link change somehow?

Recent topics in "Apache Web servers"

Topic Author Replies Last Post
New mac dev help needed jedi 1 August 11, 2007
can you be on call for this server and make some easy cash? 0 June 13, 2007
hosting reliability and live support 4 February 10, 2007
mySQL nat 2 November 29, 2006