Great Reviews!Need help setting up your website, installing Apache, PHP, MySQL, or RavenNuke(tm)?Need help customizing or designing scripts?Please contact us via the Contact Us option for further details and pricing.
URL's that end with trailing slash, like index.php/ wreck havoc in PHP Nuke
I got an email today asking me if there was a bug on my site. The person mistyped the url as http://www.nukescripts.net/index.php/ and it caused an interesting effect. The index page loaded but would not load any of the style of graphics it should have. I then tested that with /admin.php/ and it caused the same effect. While this is not an exploit it is very upsetting that it happens at all so here is the cure:
Open your mainfile.php and put:
if($_SERVER['REQUEST_URI'] != "/" AND substr($_SERVER['REQUEST_URI'], -1) == "/") {
header("Location: http://".$_SERVER['HTTP_HOST'].rtrim($_SERVER['REQUEST_URI'],'/'));
}
right after the opening < ?php. If your running NukeSentinel(tm) place it above the NukeSentinel(tm) inclusion and after the < ?php .
If you use Apache and have access to either the httpd.conf file or the .htaccess file, you can use the following code at the server level:
Re: URL's that end with trailing slash, like index.php/ wreck havoc in PHP Nuke (Score: 1) by money on Wednesday, December 15, 2004 @ 21:37:04 EST Not registered user
This problem can be fixed by simply adding a base tag between the [head][/head] tags in the page's header.