Jump to content

Internal Redirect


The Little Guy

Recommended Posts

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]

Link to comment
https://forums.phpfreaks.com/topic/126639-internal-redirect/
Share on other sites

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).

Link to comment
https://forums.phpfreaks.com/topic/126639-internal-redirect/#findComment-654985
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.