I am working on making my site more SEO friendly I am currently using
RewriteEngine On
RewriteRule (.*)$ index.php?page=$1
To turn site.co.uk/index.php?page=page_name
into site.co.uk/page_name
I want to also use this for sub pages too. I have tried this:
RewriteEngine On
RewriteRule (.*)/(.*)$ index.php?page=$1&subpage=$2
but its not working, it runs site.co.uk/page_name/sub_page
but when you go to site.co.uk/page_name
it returns the 404 not found.
I want it to run site.co.uk/page_name
and it return page_name
or
site.co.uk/page_name/sub_page
and return sub_page
and so on
site.co.uk/page_name/sub_page/sub_page2/...