I am currently trying to make pretty url and I tried code from other post and was successful to rewrite using below code
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?g/(.*?)/?$ /g.html?name=$1 [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /g\.html\?name=([^\&\ ]+)
RewriteRule ^/?g\.html$ /g/%1? [L,R=301]
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]
It changes my main folder g.html?name=this into g/this but I need to rewrite html file in my sub folder which is /sub/w.html plz help to make it aslo sub/w/this