I'll write some examples to see if I can help you ...
Example with 1 querystring
In the case of the URL www.domain.com/pagina-x , it will be interpreted as www.domain.com/index_.php?pagename=pagina-x / p>
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index_.php?pagename=$1
Explanation:
-
RewriteEngine On
- > Enable rewriting support
-
RewriteCond %{SCRIPT_FILENAME} !-f
- > Does not apply condition to files
-
RewriteCond %{SCRIPT_FILENAME} !-d
- > Does not apply condition to directories
-
RewriteRule ^(.*)$ index_.php?pagename=$1
- > Rewrite rule where any string (. *) After the folder, where the .htaccess is, will be interpreted by index.php passed in the variable pagename
Example with 2 querystring (eg language + page)
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)/(.*)$ site.php?lang=$1&pagename=$2
Link user request - > www.domain.com/products
Server-side - > www.domain.com/site.php?lang=en&pagename=products
Example with 2 querystring (eg page + subpage)
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)/(.*)$ index.php?page=$1&subpage=$2
Link user request - > www.domain.com/page_X/subpage_Y
Server-side - > www.domain.com/index.php?page=page_X&subpage=subpage_Y