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

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:  6573
Joined  03-23-2006

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
BambooInvoice - Open Source, CodeIgniter powered invoicing.

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

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  04-17-2007

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 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  397
Joined  09-20-2007

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

Also works.

See this thread.

 Signature 

Plurk > Pownce > Twitter

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

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:  1819
Joined  07-30-2007

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  05-27-2008

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: 62417 Total Logged-in Users: 41
Total Topics: 76655 Total Anonymous Users: 1
Total Replies: 414103 Total Guests: 464
Total Posts: 490758    
Members ( View Memberlist )
Newest Members:  Glikstasprugmandgil2004leiframseySpadXIIIharyAVcompleetyouknowwhord Limosinmitcha