ScotlandPHP 2019


Please answer this simple SPAM challenge: max(eight, one)?
(Example: nine)

The Note You're Voting On

11 years ago
May some servers not allow you to put this line (i.e this not work)

AddType application/x-httpd-php .asp .py .pl
DefaultType application/x-httpd-php

so, the alternative method that really a good one is:

1- In your .htaccess file write:

RewriteEngine  on
RewriteBase  /dire/ or just /
RewriteRule  securename   yourfile\.php  [T=application/x-httpd-php]

example: all url like  parsed as

2- but here the $_GET not work, but $_POST work, so for dynamic pages like you use

now: instead of using $_GET use
$page        = strstr($uri, '=');
$page        = substr($page, 1);
$valid_pages = array('1', '2','...');
$page        = in_array($page, $valid_pages) ? $page : '1';

and for bad URL you can add this code to .htaccess file
of coarse below the first code in .htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ [L]

<< Back to user notes page

To Top