Part of the EllisLab Network
This thread is a discussion for the wiki article: Dreamhost .htaccess
   
2 of 2
2
Dreamhost .htaccess
Posted: 02 November 2010 08:52 PM   [ Ignore ]   [ # 16 ]  
Summer Student
Total Posts:  3
Joined  11-02-2010

Hi I set:

<IfModule mod_rewrite.c>
  Options +MultiViews +FollowSymLinks
 
  DirectoryIndex index.php index.html
  RewriteEngine on

  RewriteRule modules/(.+)/controllers/(.+)\.php$ /index.php?/$1/$2 [L,R=301]
  RewriteRule controllers/(.+)\.php$ /index.php?/$1 [L,R=301]
 
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

and index_page is set to “” and my uri_protocol is set to the default “AUTO”.

But i get 404 error. My CI vesion is 1.7.2

I aslo set CGI (instead FastCGI). Please help why that does not work at dreamhost. ((((

Profile
 
 
Posted: 02 November 2010 11:14 PM   [ Ignore ]   [ # 17 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1101
Joined  08-06-2006

welcome to CI saifa!

i just debugged this very problem on dreamhost last week.

here’s what was happening to us: similar htaccess setup, FCGI processes were being shutdown by dreamhost robots for using too many resources. the request went to a static/standalone page (outside of CI) and because of the way that apache was bailing out of the shutdown it actually triggered the final htaccess rewrite rule and generated 404s from the CI stack.

we moved to dreamhost VPS and now the problem is gone - it was a resource issue manifesting as 404 error pages.

YMMV.

 Signature 

peeker email (imap/pop) | site_migrate | OOCalendar | PhotoBox2 | word_limiter

Profile
 
 
Posted: 03 November 2010 01:41 AM   [ Ignore ]   [ # 18 ]  
Summer Student
Total Posts:  3
Joined  11-02-2010

sophistry thanks!

I’m in VPS already and it does not work. (((.

Can you post your .htaccess settings and config settings.
Do you set FastCGI or CGI?

what are really working settings?

Please share because there are so many advices and i’m confused.

Thanks

Profile
 
 
Posted: 03 November 2010 08:56 AM   [ Ignore ]   [ # 19 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1101
Joined  08-06-2006

just this… same as the others in here - note question mark in last rule.

this works for me when the processes are not killed by DH process watcher robots:

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


how would config would affect 404s? in our case, it was htaccess. why not try removing htaccess and see what happens (as a test to narrow down the problem).

also, we had _remap() that actually ended up handling the 404 so that was an extra layer of redirection that needed to be removed before seeing the real culprit: apache processes being nuked by DH and “dying” inside htaccess (triggering the last rule).

using FCGI only, did not test with CGI. also, mod_php on DH has a bug with one of the PHP imap_ functions so we can’t use it until they fix that.

cheers.

 Signature 

peeker email (imap/pop) | site_migrate | OOCalendar | PhotoBox2 | word_limiter

Profile
 
 
Posted: 03 November 2010 09:34 AM   [ Ignore ]   [ # 20 ]  
Summer Student
Total Posts:  3
Joined  11-02-2010

Thanks for your effort to help me. Tomorrow i will try CI setup in Dreamhost last time. If that does not work i would wait version 2.0 and jump back to ZendFramework, which is more useful at the moment.  I spent 1,5 week to transfer from ZF to CI, sh-t… did not know that is so painful…

Profile
 
 
Posted: 03 November 2010 09:53 AM   [ Ignore ]   [ # 21 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1101
Joined  08-06-2006

ok, no problem. one more thing, check that you have removed index.php from the config file if you are using the htaccess file that expects it to be removed.

here’s what i would do to debug:

1) clean install of CI, no htaccess, visit welcome page - getting 404s? no? go to next step. yes? something’s wrong with routing.
2) clean install of CI, add most basic DH htaccess file, visit welcome page, create new controller and/or method - getting 404s? no? go next
3) clean install of CI, add the controller where you see the problem, zero in on method where it happens - getting 404s? no? go next
4) clean install of CI, put server under heavier load to see if you can trigger 404s

etc…

step by step we succeed.

good luck.

 Signature 

peeker email (imap/pop) | site_migrate | OOCalendar | PhotoBox2 | word_limiter

Profile
 
 
Posted: 26 June 2011 06:34 AM   [ Ignore ]   [ # 22 ]  
Summer Student
Avatar
Total Posts:  7
Joined  11-15-2009

I finally got my application working on DreamHost.  I’m running it in a sub-folder as well.  The .htaccess file that I’m using is:

<IfModule mod_rewrite.c>
    
Options +FollowSymLinks 
    RewriteEngine On 
    RewriteCond 
%{REQUEST_FILENAME} !-
    RewriteCond 
%{REQUEST_FILENAME} !-d
    RewriteRule 
^(.*)$ index.php?/$1 [L]
</IfModule

I have the following set in config.php

$config['uri_protocol']    'AUTO'

So far it seems to be working flawlessly.  I’ll keep you posted.

Profile
 
 
Posted: 01 July 2011 04:36 AM   [ Ignore ]   [ # 23 ]  
Summer Student
Avatar
Total Posts:  4
Joined  04-22-2011

I am happy the forum gives us the necessary information to create wonderful apps.
Keep the info coming guys.

 Signature 

A concept is a product that everyone wants, but nobody has invented yet…
Find us @ FOURCONCEPTS.NL

Profile
 
 
Posted: 03 September 2011 12:27 AM   [ Ignore ]   [ # 24 ]  
Grad Student
Avatar
Rank
Total Posts:  75
Joined  11-17-2010
Miguel Ramos - 26 March 2010 06:16 PM

My dreamhost .htaccess working 100%.
In config.php, my index_page is set to “” and my uri_protocol is set to the default “AUTO”.

<IfModule mod_rewrite.c>
    
Options +MultiViews +FollowSymLinks
    
    DirectoryIndex index
.php index.html
    RewriteEngine on

    RewriteRule modules
/(.+)/controllers/(.+)\.php$ /index.php?/$1/$2 [L,R=301]
    RewriteRule controllers
/(.+)\.php$ /index.php?/$1 [L,R=301]
    
    RewriteCond 
%{REQUEST_FILENAME} !-f
    RewriteCond 
%{REQUEST_FILENAME} !-d
    RewriteRule 
^(.*)$ index.php?/$1 [L]
</IfModule

That’s all.

Regards…. cool smile


I know this is an old post but thanks Miguel. I was ripping my hair out trying to get clean urls with ci and dreamhost.

Thanks again!

Ed

 Signature 

“ain’t nobody here but us CHICKENS!”


http://codeigniter.com/forums/viewthread/125687/
http://codeigniter.com/user_guide/


Remember, search is your friend = Do a search before posting a topic

Profile
 
 
Posted: 07 September 2011 03:11 AM   [ Ignore ]   [ # 25 ]  
Summer Student
Avatar
Total Posts:  8
Joined  09-07-2011

wonderful post,it is so helpful—-luggage bags

 Signature 

belouisvuitton

Profile
 
 
   
2 of 2
2
 
‹‹ Modular Extensions - HMVC      DataMapper ››