Jump to content
alexfung

Rewriterule Fails After Php Upgrade

Recommended Posts

My pages worked fine last week. After the weekend upgrade it broken. I think I've narrowed it to the .htaccess.

 

RewriteEngine on

RewriteRule (.*)\.x.l$ http://bank.alexfung.info/loadxxl.php [PT]

 

The idea is, all requests for .xml and .xsl files will be routed to this php, which then file_get_contents() the files from a read directory that the http demon is told not to access.

 

I have reduced the php to read:

 

$uri=$_SERVER["REQUEST_URI"];

echo $uri;

exit;

 

but still:

URI = loadxxl.php: runs correctly

URI = xxx.xml: gets "400 Bad Request" <-- why?

URI = xxx.xxx: gets "404 Not Found" as expected

 

Any ideas why this would fail after the PHP upgrade?

Share this post


Link to post
Share on other sites

Are those the only 2 lines in your .htaccess file? Could be something else in there is causing the failure.

Share this post


Link to post
Share on other sites

Is there a specific reason you're using the [PT] passthrough flag? If you don't do any subsequent processing that requires it, you could try removing it.

 

RewriteEngine on

RewriteRule \.x[ms]l$ http://bank.alexfung.info/loadxxl.php [NC,L]

 

There are two potential sources of different behavior,

The new PHP version, and

Apache 1.3 -> Apache 2.

You've reduced the PHP file to the bare bones, so differences in the new Apache might be the more likely cause.

 

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

Edited by SteveW

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...