Dreamhost .htaccess

Alen Birindzic edited this page Sep 1, 2013 · 14 revisions
Clone this wiki locally

Category:Config::Host

Solution 1

Create a file called .htaccess, paste the following code into the document and upload to your server at the root web directory.

RewriteEngine on
RewriteCond $1 !^(index\.php|public|user_guide|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]

NOTE: The previous solution also works for ICDSoft hosting.

Solution 2

  1. Open system/application/config/config.php
  2. Set ```php $config['index_page'] = "";
3. Set ```php
$config['uri_protocol']    = "REQUEST_URI";
  1. Add this .htaccess file to your server root (or in the folder where your files are located). Be sure to change the RewriteBase to match your folder location:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /rbs/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

Solution 3

Create a file called .htaccess, paste the following code into the document and upload to your server at the root web directory.


# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>

Solution 4

Create a file called .htaccess at the root web directory, paste the following code into it.


RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?/$0 [PT,L,QSA]