Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your solution for 2 will loop, but simple enough to fix, stick something along the following lines in your file for part 2 and 3:</p> <pre><code>#If the Browser request contains a .php, instruct the browser to remove it. RewriteCond %{THE_REQUEST} \.php [NC] RewriteRule ^/?(.*)\.php$ http://%{HTTP_HOST}/$1 [R=301,NC,L] #If a request is received for a non file-system object, that doesn't have a .php suffix, then store the full path, filename, and URI in a variables with that extention. RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-s RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !^\.php$ [NC] RewriteRule ([^/]+)$ - [E=testScript:%{SCRIPT_FILENAME}.php,E=testFile:$1.php,E=testURI:%{REQUEST_URI}.php] #See if the file exists with a .php extention, if it does internally rewrite RewriteCond %{ENV:testScript} -s [OR] RewriteCond %{ENV:testScript} -f RewriteRule .* %{ENV:testURI} [L] #Else if a ENV:testDile is set, then pass the name to the php script RewriteCond %{ENV:testFile} !^$ RewriteRule .* /filechecker.php?page=%{ENV:testFile} [L] </code></pre> <p>FYI: The Apache <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html" rel="nofollow">mod_rewrite</a> documentation is worth a read, if your unclear as to what the above rules do, or if you want something a little more abstract consider the following <a href="http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Apache/A_4043" rel="nofollow">post</a>. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload