Mod_rewrite issue


#1

Hey, I have a question about using mod_rewrite in my .htaccess file on my domain hosted at dreamhost. The problem is, i’m trying to remove index.php from the url, however when I use the mod_rewrite rules to do this in my .htaccess I don’t think that it is working properly. Here is the htaccess rules that I am currently using:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

The site is http://ryanblaind.com

so, say for instance I wanted to go to http://ryanblaind.com/about this produces a 404, because its not writing the index.php, but if you go to http://ryanblaind.com/index.php/about it works… anyone have any suggestions? Thanks :slight_smile:

Ryan


#2

I am trying to figure out why its not working in the first place.
Are you using a rewrite rule to prettify the url?
As the url you posted states "http://ryanblaind.com/about " That you have a file called about with no extention in your ryanblaind.com folder. http://ryanblaind.com/index.php/about looks like it has been prettified and index.php is a dynamic web page getting data called about.
Silk

My website


#3

Well, usually you do like this:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?x=$1 [L,QSA]

And the php code use the $_GET[‘x’] or other methods to get the parameter.

I thought this worked for CGI, but I’ve not tested it on DH.
http://example.com/whatever.cgi/parameter

I don’t know if it works for php on DH.

...* I’d be happier if DH had free shared SSL and redundant server setup. ..*.
http://Hostwick.com/