Question
Problems with apache RewriteRule in 2:22
enabled the rewrite module with the command sudo a2enmod rewrite
and changed sudo nano / etc/apache2/sites-available/default thereby:
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Only if perchance there is a file with the same name is independent of the extent it does not go through mine. Htacess
RewriteEngine On
RewriteBase /
RewriteCond% {REQUEST_FILENAME}!-F
RewriteCond% {REQUEST_FILENAME}!-D
RewriteRule ^ (. *) $ Sessao.php [NC, L, QSA]
Here too my sessoes.php:
$ gets = explode ("/", str_replace (strrchr ($ _SERVER ["REQUEST_URI"]), "", $ _SERVER ["REQUEST_URI"]) "?");
for ($ i = 1; $ i <= count ($ gets); $ i + +) {
$ var = "p $ i";
$ $ var = addslashes ($ gets [$ i]);
}
if (file_exists ($ p1.. "php")) {
include ("$ p1 test.". "php.");
Else {}
header ("Location: /");
exit ();
}
Practical example of the situation: If I call him http://107.170.237.146/base load http://107.170.237.146/base.html find the same if you can not find it search http://107.170.237.146/base . php if he does not find load sessoes.php
But right serious: He always sessoes.php first pass through and then drop the html or php..
Add a comment
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×