For example i have
3 php pages
For good SEO . I need URL like
I got something URL rewriting with PHP but am confused how to implement it for multiple dynamic PHP pages. i need all the variables for proper functioning of php pages
Put this code in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteRule ^(page1|page2|page3)/([^-]+)-([^-]+)-([^-/]+)/?$ /$1.php?var1=$1&var2=$2&var3=$3 [L,QSA,NE]
In your .htaccess you should add the line:
RewriteRule ^(\w+)/(\w+)-(\w+)-(\w+)$ /$1.php?var1=$2&var2=$3&var3=$4 [QSA]
The first part captures the page name (script name, in your case), then each successive query string parameter. The QSA
key tells the redirect to take any additional query string parameters not specified explicitly along with the request.