this question is Basic but important. i need to rewrite php url using .htaccess . e.x one : i have many file with .php extension . e.x two : i need seo url friendly with name and html extension.
example 1 :
http://mydomain.com/editname.php
http://mydomain.com/location.php
.....
I need to rewrite all to :
http://mydomain.com/editname/
http://mydomain.com/location/
example 2 :
http://mydomain.com/name.php?id=1
http://mydomain.com/state.php?id=1
rewrite to : ( john & bsw is really name and inserted to mysql)
http://mydomain.com/name/1/john.html
http://mydomain.com/state/1/bsw.html
NOTE : If non of this, redirect to 404 not found page.
thanks.
To redirect simple folders to PHP files:
And then do redirect your SEO friendly URLs:
The
RewriteCondlines check to make sure the request isn’t already a valid file.