Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP-cgi breaks my mod_rewrite

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

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    Quote Originally Posted by Sykoi View Post
    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"?
    Quote Originally Posted by Sykoi View Post
    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.

  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •