php - Get variables show up in sub-sub directory rewrites, mod_rewrite -



site link domain.com/index?page=projects

here .htaccess:

options +followsymlinks -multiviews  <ifmodule mod_rewrite.c>      setenv http_mod_rewrite on     rewriteengine on     rewritebase /      rewritecond %{the_request} ^\w+\ /(.*)\.php(\?.*)?\ http/     rewriterule ^ http://%{http_host}/%1 [r=301]      rewritecond %{request_filename}.php -f     rewriterule .* $0.php   </ifmodule> 


want convert vars sub directory.
this: domain.com/index/projects or domain.com/projects
how this?
thanks

change rules this:

rewritecond %{the_request} ^\w+\ /(.*)\.php(?:\?page=([^&\ ]+)|)\ http/ rewriterule ^ http://%{http_host}/%1/%2? [r=301,l]  rewritecond %{document_root}/$1.php -f rewriterule ^(.*)/([^/]+)$ $1.php?page=$2 [l]  rewritecond %{document_root}/$1.php -f rewriterule ^(.*)$ $1.php [l] 

Comments