I'm new with htaccess file, so I'm kindly asking you to help:
In my htaccess file I have next lines:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^alpe-adria(.*)$ site/index.php$1 [L]
RewriteRule ^alpe-adria$ site/index.php?box=1&d=3 [L]
So, first I'm trying to set index file, that is in site folder, to show as string above (alpe-adria). Second RewriteRule is my landing page, other pages have same root as seen in the first RewriteRule. When I localy test this rules, my landing page shows as expected (typing localhost/alpe-adria in browser). But then if I want to go to other pages, which have for instance such basic URL:
http://localhost/site/index.php?d=1&box=1&grp=306&level=1
RewriteRule acts OK, rewriting this into
'http://localhost/alpe-adria?d=1&box=1&grp=306&level=1'
but site stil stays on my landing page - like it is written in second RewriteRule
I was also trying to set some more RewriteCond and adding another RewriteRule:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^alpe-adria?d=([^/]+)&box=([^/]+)&grp=([^/]+)&level=([^/]+)$ site/index.php?d=$1&box=$2&grp=$3&level=$4
and site stil doesn't change. What am I doing wrong? Thanks for any help :)
.htaccessnot your code? What do you mean that the site doesn't change? Maybe it's something inindex.phpwhich wrongly recognizes the attributes.http://localhost/alpe-adria?d=1&box=1&grp=3&level=1_GET dump ->array (size=2) 'box' => string '1' (length=1) 'd' => string '3' (length=1)