The Little Guy Posted October 1, 2008 Share Posted October 1, 2008 OK, I would like to have EVERY PHP file directed and ran through another PHP file. Currently I have this, and it gives me an 500 error Options +FollowSymlinks RewriteEngine On RewriteRule statistics/javascripts/stats.js statistics/javascripts/stats.php RewriteRule ^(.*\.(php|js))$ rFile.php?filename=$1 [nc] Quote Link to comment Share on other sites More sharing options...
svivian Posted October 1, 2008 Share Posted October 1, 2008 I don't know if this is your problem but rFile.php ought to have a slash on the front. If you're in a subfolder it may be looking for the file in the wrong place. Second, does it work if you replace it with two lines, one matching php and one matching js? In other words, splitting the (php|js) part. Also, not a cause of the problem, but why do you rewrite a .js file as a .php file? If it has PHP code in then you could force the JS file to act as PHP (and optionally adding a content-type header to the end of the file to set it back to javascript again). Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted October 1, 2008 Author Share Posted October 1, 2008 give it a JavaScript "content-type" for the JavaScript file Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted October 1, 2008 Author Share Posted October 1, 2008 This works on my other domain: RewriteRule ^(.*\.(jpg|gif|png))$ images.php?filename=$1 [nc] Quote Link to comment Share on other sites More sharing options...
corbin Posted October 2, 2008 Share Posted October 2, 2008 Have you tried checking the Apache error log? Quote Link to comment Share on other sites More sharing options...
svivian Posted October 2, 2008 Share Posted October 2, 2008 If a similar .htaccess works on a different site, it quite possible there is some problem with Apache configuration, for example you may not be able to use the rewriterule or change the options. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted October 3, 2008 Author Share Posted October 3, 2008 They are both running on the same server... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.