Part of the EllisLab Network
   
 
Quick & dirty: Dreamhost .htaccess
Posted: 08 September 2007 04:17 AM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  6
Joined  2006-06-03

Hello Guys,

I don’t know whether its the right place to post this, but wanted to share this to those newbies who face problem in hosting CI in dreamhost and can’t make the .htaccess work. Here goes the quick steps to follow for solving that:

1. Open system/application/config/config.php

2. Set

$config['index_page'] = "";

3. Set

$config['uri_protocol']    = "REQUEST_URI";

4. 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>

5. Thats it! Now enjoy CI in peace.

Regards,

Md Emran Hasan
Co-founder & CTO
Right Brain Solution

Profile
 
 
Posted: 08 September 2007 03:30 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6272
Joined  2006-03-23

This is great, thanks.  You might also want to add it to the wiki!

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

Profile
 
 
Posted: 08 September 2007 04:06 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  6
Joined  2006-06-03

You’re welcome, Derek!

Just posted in the Wiki: Dreamhost .htaccess

Profile
 
 
Posted: 26 September 2007 05:06 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  2
Joined  2007-04-17

I followed the steps above but I get a 500 internal Server error every time. I tried changing the php version to 4 but with no joy.

Any suggestions?

scratch that works fine now wink

Profile
 
 
Posted: 03 November 2007 03:11 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  300
Joined  2007-09-20

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

Also works.

See this thread.

Profile
 
 
Posted: 05 June 2008 07:08 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  4
Joined  2008-05-27

Using the instructions above, I’m still getting an Internal Server Error.

My .htaccess file is as follows:

<IfModule mod_rewrite.c>
    
RewriteEngine On
    RewriteBase
/calley/
    
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>

My dreamhost username is ‘calley’. The files are in a subdirectory called ofnirdev.uriptical.com, so the full path to the index file is: /home/calley/ofnirdev.uriptical.com/index.php

I’ve tried putting the .htaccess file in both /home/calley and /home/calley/ofnirdev.uriptical.com

Help would be much appreciated.

Profile
 
 
Posted: 05 June 2008 07:16 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRank
Total Posts:  1674
Joined  2007-07-30

If index.php is found at /home/calley/ofnirdev.uriptical.com/index.php then:

You would place the .htaccess file in /home/calley/ofnirdev.uriptical.com as well as change the RewriteBase to /home/calley/ofnirdev.uriptical.com.

 Signature 

MichaelWales.com

Profile
 
 
Posted: 05 June 2008 06:15 PM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  4
Joined  2008-05-27

Thanks for your help Michael. Unfortunately the issue continues.

The page that I’m trying to load is:

http://ofnirdev.uriptical.com/user/join

This works on my local Windows machine, using a different .htaccess file. The default controller is ‘user’, and join is function of that class which displays a form.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 58779 Total Logged-in Users: 16
Total Topics: 69461 Total Anonymous Users: 0
Total Replies: 373908 Total Guests: 239
Total Posts: 443369    
Members ( View Memberlist )