• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quick & dirty: Dreamhost .htaccess

#1
[eluser]PHP Four[/eluser]
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
Code:
$config['index_page'] = "";

3. Set
Code:
$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:

Code:
<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

#2
[eluser]Derek Allard[/eluser]
This is great, thanks. You might also want to add it to the wiki!

#3
[eluser]PHP Four[/eluser]
You're welcome, Derek!

Just posted in the Wiki: Dreamhost .htaccess

#4
[eluser]Unknown[/eluser]
<strike>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?</strike>

scratch that works fine now ;-)

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

Also works.

See this thread.

#6
[eluser]Uriptical[/eluser]
Using the instructions above, I'm still getting an Internal Server Error.

My .htaccess file is as follows:

Code:
<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.

#7
[eluser]Michael Wales[/eluser]
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.

#8
[eluser]Uriptical[/eluser]
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.

#9
[eluser]MrWonderful[/eluser]
I like quick and dirty for dreamhost but here is what I need to do on dreamhost. I need to have a htaccess with these in it:

Code:
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200

Dreamhost has a utility that appears to create them but then it talks about only being able to control it with WebDev, whatever that is. Any help here?

-MrWonderful

#10
[eluser]Nexus Rex[/eluser]
[quote author="PHP Four" date="1189261029"]Hello Guys,
3. Set
Code:
$config['uri_protocol']    = "REQUEST_URI";
[/quote]
This solved my problems on both MAMP and BlueHost. After spending hours messing with the .htaccess it was just that simple all along.

Thank you!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.