I need to have 1 variable or sometimes 2 variables in my url.
http://example.com/home
or http://example.com/home/hr
I created the following .htaccess
file in public_html
folder:
RewriteEngine On RewriteRule ^([a-zA-Z0-9]+)$ index.php?page=$1
RewriteRule ^([a-zA-Z0-9]+)/$ index.php?page=$1 ReWriteRule
^([^/]+)/(\d+)/? index.php?page=$1&q=$2
It's not working! I do have index.php
in public_html
and hr.php
in public_html/view
now hr.php
is included in index.php
:
include("view/hr.php")
so now index.php
has page variable and /view/hr.php
has the 2nd variable.
How can I make it work?