+ Reply to Thread
Results 1 to 5 of 5

Thread: lost default .htaccess file settings

  1. #1

    Default lost default .htaccess file settings

    As part of trying to move my working subdomain to be accessible using just 'www.mydomain.com' I've messed up and lost my original .htaccess file and now my site just shows my directory listing of my subdomain's public folder.

    Can anyone post the default .htaccess file contents and where it should go so I can start over with at least my original subdomain working again?

    Thanx in advance!

    Russcky

  2. #2
    Join Date
    Feb 2006
    Location
    Florida, USA
    Posts
    1,349

    Default

    There's nothing in the original .htaccess file, you just need an index(.html,.php etc.).

  3. #3

    Default Using Ruby on Rails

    My site is a Ruby on Rails application so I'm not using a index.html or php file there... any idea what it should be for RoR?

  4. #4
    Join Date
    Feb 2006
    Location
    Florida, USA
    Posts
    1,349

    Default

    I don't know much about RoR, but I think it should be something like 'index.rhtml'.

    If it doesn't work automatically, make a .htaccess file containing this..
    Code:
    Options -Indexes #forbids access to directories without indexes, just a safety thing
    DirectoryIndex index.rhtml index.html index.htm index.php #whatever index files you want the server to look for, order of importance from left to right

  5. #5

    Smile Solved it... got it back to the default and it worked!

    Here is what the default .htaccess file was:


    # General Apache options
    AddHandler fastcgi-script .fcgi
    AddHandler cgi-script .cgi
    Options +FollowSymLinks +ExecCGI

    # If you don't want Rails to look in certain directories,
    # use the following rewrite rules so that Apache won't rewrite certain requests
    #
    # Example:
    # RewriteCond %{REQUEST_URI} ^/notrails.*
    # RewriteRule .* - [L]

    # Redirect all requests not available on the filesystem to Rails
    # By default the cgi dispatcher is used which is very slow
    #
    # For better performance replace the dispatcher with the fastcgi one
    #
    # Example:
    # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    RewriteEngine On

    # If your Rails application is accessed via an Alias directive,
    # then you MUST also set the RewriteBase in this htaccess file.
    #
    # Example:
    # Alias /myrailsapp /path/to/myrailsapp/public
    # RewriteBase /myrailsapp

    RewriteRule ^$ index.html [QSA]
    RewriteRule ^([^.]+)$ $1.html [QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

    # In case Rails experiences terminal errors
    # Instead of displaying this message you can supply a file here which will be rendered instead
    #
    # Example:
    # ErrorDocument 500 /500.html

    ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"

+ Reply to Thread

Posting Permissions

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