.htacces
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^([a-zA-Z0-9_-]+)$ sinj.com.hr/index.php?var1=$1 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ sinj.com.hr/index.php?var1=$1&var2=$2 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ sinj.com.hr/index.php?var1=$1&var2=$2&var3=$3 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ sinj.com.hr/index.php?var1=$1&var2=$2&var3=$3&var4=$4 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/$ sinj.com.hr/$1 [R=301,L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ sinj.com.hr/$1/$2 [R=301,L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ sinj.com.hr/$1/$2/$3 [R=301,L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ sinj.com.hr/$1/$2/$3/$4 [R=301,L]
There is folder sinj.com.hr/administracija and when I try to access http://localhost/sinj.com.hr/administracija I am redirected to http://localhost/sinj.com.hr/administracija?var1=administracija What I would like is when user enters http://localhost/sinj.com.hr/administracija that he is redirected to http://localhost/sinj.com.hr/administracija/index.php. I tried to do this with header("Location:... ") but it always redirects me to http://localhost/sinj.com.hr/administracija?var1=administracija. If folder administracija is renamed then header() function works. Any ideas how to solve this?
Thanks, Ile