Results 1 to 8 of 8
I am switching over to a new server and I edited the httpd.conf file to be similar to my old server. I have a mod rewrite rule to remove .php ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-03-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 12
Remove Extensions "Not Found" Error??
I am switching over to a new server and I edited the httpd.conf file to be similar to my old server. I have a mod rewrite rule to remove .php extensions, which does work - but when it rewrites to http://domain.com/index I get a Not Found 404 error. Just going to http://domain.com will bring up the file, but if I try to access any files, it will rewrite and remove the extension properly, but I will get a 404 error for that file.
I set DefaultType application/x-httpd-php - Not sure if this is an Apache or PHP problem.
- 02-03-2009 #2Just Joined!
- Join Date
- Jan 2009
- Posts
- 12
Follow up: I don't think this is an issue with the rewrite rule, as it is working as far as removing the extension. But I am getting a Not Found error thereafter.
Could this be an issue with the DefaultType or MIME
Rewrite rule, just in case:
Code:RewriteEngine On RewriteBase / Options Indexes FollowSymLinks AllowOverride None # # Remove ".php" RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\.php.*(.*)\ HTTP RewriteRule (.+)\.php.*(.*)$ $1$2 [R,L]
- 02-04-2009 #3Linux Newbie
- Join Date
- Apr 2008
- Location
- India
- Posts
- 170
Regards
David.s
davidanands.co.cc
-->Success is the list of failures ...!!!
- 02-04-2009 #4Just Joined!
- Join Date
- Jan 2009
- Posts
- 12
- 02-05-2009 #5Just Joined!
- Join Date
- Jan 2009
- Posts
- 12
Anyone have any ideas?? Is this an Apache issue?
- 02-05-2009 #6Linux Newbie
- Join Date
- Apr 2008
- Location
- India
- Posts
- 170
Hello.
post the error logs form Apache ..Regards
David.s
davidanands.co.cc
-->Success is the list of failures ...!!!
- 02-05-2009 #7Just Joined!
- Join Date
- Jan 2009
- Posts
- 12
I enter info.php, it rewrites and removes the extension so you have http://domain.com/info - then it give Not Found error
So the rewrite seems to be working, but it seems to not be properly translating the extension when it is gone.
Log:
Code:[Thu Feb 05 22:35:43 2009] [error] [client] script '/var/www/html/info' not found or unable to stat [Thu Feb 05 22:35:43 2009] [error] [client] script '/var/www/html/error' not found or unable to stat
- 02-05-2009 #8Just Joined!
- Join Date
- Jan 2009
- Posts
- 12
Figured it out. Needed to add Options +Multiviews
Didn't have this on the old config on OS X and it worked. Crazy.
At least it works.


Reply With Quote

