you can either create each case or have a dynamic
Note: if the folder exists and you need to add this:
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
if you create each case, you will need to specify each subfolder, for example:
RewriteRule ^contact/test/([_a-zA-Z0-9]+)/?$ /contact.php?test=$1 [L,QSA]
if this is dynamic for you, you will have to process each page in the main php file, and then create the logic in this file to analyze the correct information:
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)/([_a-zA-Z0-9]+)/?$ /index.php?page=$1&subpage=$2&lastpage=$3 [L,QSA]
source share