...

View Full Version : PHP-cgi breaks my mod_rewrite



Sykoi
08-15-2007, 08:22 AM
On the advice of a few people on another forum, I had my sysadmin install SuPHP - so that my upload script would work properly, however now my mod_rewrite is broken.

You can view the problem here: http://www.eyesoute.com/gallery/view-29

It is supposed to show the item with id 29, as you can see. However it shows the gallery index (As if /gallery/ was typed in without the view-29)

The .htaccess file:


#.htaccess


RewriteEngine On
#This will force trailing slashes
RewriteCond %{SCRIPT_FILENAME} -f [OR]
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule .* - [L]

#RewriteCond %{REQUEST_URI} !^*(css|png|jpe?g|gif)



RewriteRule ^(.+)/(.+)/?$ $1.php?args=$2 [QSA,L]
RewriteRule ^(.+)$ $1.php [QSA,L,NC]


My very framework relies on the .htaccess working this way... I can turn it off, however I would really rather not - so if you have any idea how I can fix this, please do tell.


And on a related note, is it possible to run PHP under a user and not use cgi_php?

Would also like to note that my Mediawiki wiki is now completely broken, and refuses to load - as it relies on similar rewrite rules.

Inigoesdr
08-16-2007, 01:05 AM
You can view the problem here: http://www.eyesoute.com/gallery/view-29

PHP seems to be working. You might want to check the settings to be sure everything is correct. The rewrite code works, so either it's not being received by the PHP parser or your gallery code is messed up, which I doubt because the url with the query string works. Is there a folder/file called "gallery"?

And on a related note, is it possible to run PHP under a user and not use cgi_php?
You should be able to run PHP as any user as long as the permissions are setup properly, but if you're on a shared host I doubt they would allow that. Also you may have to change some settings for SuPHP to work properly as another user.

Sykoi
08-16-2007, 05:16 AM
What settings, specifically? Also, my gallery code is fine - I tested it with a phpinfo(); page to see if there were even any requests being sent - and there aren't, so its just not being received.
And sadly there isn't a folder called gallery

Inigoesdr
08-16-2007, 10:17 PM
php.ini; nothing in particular, just make sure the paths are all correct, and nothing obvious is wrong. If you put phpinfo(); in your gallery script and it didn't get any requests then the problem isn't with PHP(barring some incorrect setting). You might want to try some tests with your rewrite code, I didn't try it out extensively before.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum