I would like the prevent users from bypassing my CMS to look at the HTML files directly.
I want to force users to use PostNuke:
Example: http://domain/page.php?url=/directory/content.html
Then block users from simply entering:
http://domain/directory/content.html
How should I go about doing this?
Could there be some sort of slick RewriteEngine redirect or PHP option?
Using RewriteEngine or PHP to prevent users bypassing CMS
Moderator: General Moderators
I'm currently designing a site the same way. How I'd go about it would be setting a constant in the index php page, then checking if that constant exits in the page you want to include. If it does then follow the flow of the page and if it doesn't then send a location header that redirects the user to http:domain.com/?url=domain/etc.
But then this would require you to change you page from content.html to content.php.
But then this would require you to change you page from content.html to content.php.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
I would probably go about this by using Deny from all and then <File {php file from here}> with an Allow from all. Look in to Apache's directives: mod_rewrite is not necessary for this.
Although it might be cooler to use some mod_rewrite fu to make http://domain/directory/content.html direct to the PHP script.
Although it might be cooler to use some mod_rewrite fu to make http://domain/directory/content.html direct to the PHP script.