php - Url rewriting to page1/ and page1/page2/ -


i'm not sure title of post quite clear...

i have 2 pages : page1.php , page2.php

i have mysite.com/page1 show page1.php , mysite.com/page1/page2 show page2.php

it's first time of life touch .htaccess. i've added :

rewriteengine on rewriterule    ^page1/?$    page1.php    [nc,l] rewriterule    ^page1/page2/?$    page2.php    [nc,l] 

mysite.com/page1 works fine, unfortunately mysite.com/page1/page2 shows page1.php (and not page2.php)... without css.

what advice ?

you can try rules way.

rewriteengine on rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^ - [l]  rewriterule ^page1/page2/?$ page2.php [nc,l] rewriterule ^page1/?$ page1.php [nc,l] 

Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -