php - htaccess rewrite only one folder -
i have folder in root name "pages", of html pages there, have rewrite mod, delete folder url , delete .php, www.website.com/pages/index.php, becomes: www.website.com/index.
now, problem rest of folders need in root, , when try require files folders, rewrite mod looking folders in "pages" folder , not on root folder.
i need rewrite mod on "pages" folder used, in url.
.htacces file:
options +followsymlinks rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_uri} !\.[a-za-z0-9]+$ rewriterule ^(.+?)/*$ $1.php [l,qsa] #remove subfolder pages rewritecond %{request_uri} !(.*)pages rewriterule ^(.*)$ pages/$1 [l]
any that?
you can check existence of php file using rewritecond
, forward pages/
this:
options +followsymlinks rewriteengine on rewritebase /gp/ rewritecond %{document_root}/gp/pages/$1\.php -f [nc] rewriterule ^(.+?)/?$ pages/$1.php [l] rewritecond %{request_filename} !-d rewritecond %{document_root}/gp/$1\.php -f [nc] rewriterule ^(.+?)/?$ $1.php [l]
Comments
Post a Comment