Results 1 to 4 of 4

Thread: .htaccess

  1. #1

    Default .htaccess

    I know this is the wrong place to post but I couldn't find a better category. I'd like to ask if WestHost has disabled .htaccess files by default? Things like the rewrite and redirecting don't work (I get the .htaccess scripts from other sites but they don't work). Does WestHost disable them or do I need to do anything special? Thanks.

  2. #2
    Moderator wildjokerdesign's Avatar
    Join Date
    Jun 2003
    Location
    Kansas City Mo
    Posts
    5,721

    Default

    Are you on a WH 3.0 account? If so is this on an addon domain that is not located in /var/www/html. If you answer yes to both then the answer is yes. .htaccess is only available in /var/www/html unless you modify /etc/httpd/conf/httpd.conf.

    You need to edit the VirtualHost tag for the domain in question. Here is an example of it after editing.
    Code:
    <VirtualHost *:80>
        ServerName addondomain.com
        ServerAlias www.addondomain.com
        DocumentRoot /path/to/addondomain
        <Directory "/path/to/addondomain">
           Options FollowSymLinks MultiViews Includes ExecCGI
           AddHandler cgi-script .cgi .pl .py .sh
           AllowOverride All
           Order allow,deny
           Allow from all
        </Directory>
    </VirtualHost>
    /path/to/addondomain depends on where you decided the public root of the domain should be.

    You then need to restart your account either via SSH command line using the command restart or you can do it in Site Manager with the link in the left column.

    Be careful when editing the httpd.conf file. It must be edited on the server via SSH with something like pico or vi or you must make sure you edit it on your local computer with a plain text editor and then transfer it in ASCII mode. Make a backup of the original before you edit. A mistake in your httpd.conf file even one character and keep Apache from starting.
    Shawn
    Please remember your charity of choice: http://www.redcross.org

    Handy Links: wildjokerdesign.net | Plain Text Editors: EditPlus | Crimson

  3. #3

    Default

    The answer is yes to both of those.

    If I edit this will .htacces still work at /var/www/html ?

    Things like Wordpress and PHPbb use .htaccess in internal folders so would I have to combine all of them into one .htaccess at the root directory?

    Is there something like a WestHost 4.0 account that I could upgrade to so this doesn't happen?
    Thanks.

  4. #4
    Moderator wildjokerdesign's Avatar
    Join Date
    Jun 2003
    Location
    Kansas City Mo
    Posts
    5,721

    Default

    Sorry it took me so long to answer you. I was locked out of the forum for most of the day.

    Yes .htaccess will still work in the /var/www/html directory.

    No you would not want to combine your .htaccess files for wordpress and phpBB. They should stay separate and reside in the directory they are installed into. Most .htaccess files for programs like this are designed to rout any link that does not match an actual file or directory on the system through the index.php file for that program. The index.php then takes the URL and determines what page to serve up. If you combined them and placed them in the root then they would not have the separate index.php files to route through.
    Shawn
    Please remember your charity of choice: http://www.redcross.org

    Handy Links: wildjokerdesign.net | Plain Text Editors: EditPlus | Crimson

Posting Permissions

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