I want that when you go to url: http://www.example.com/subdir/paramvalue
redirects to
http://www.example.com/subdir/index.php?param=paramvalue
My .htacce
Thanks anubhava ! First i edit 000-default from /etc/apache2/sites-available/ and add:
<Directory "/var/www">
AllowOverride All
</Directory>
Then the solution in .htaccess was:
RewriteEngine On
RewriteBase /subdir/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?param=$1 [QSA,L]
Finally in /subdir/index.php
I get the value paramvalue as:
$myParamValue = $_GET["param"];
echo myParamValue
it returns : paramvalue
Place this rule in subdir/.htaccess
(not site root):
RewriteEngine On
RewriteBase /subdir/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .+ index.php?param=$0 [L,QSA]