apache - PHP / .htaccess - Redirect to specific folder -


i creating php project, , folder structure looks like:

includes/  pages/ config/ 

in theory, of pages go pages folder. but, whenever visits website, on specific page: (i.e.) www.mysite.com/help want inside pages/ folder, rather thinking on root of document.

can achieve using php / .htaccess - have googled problem , cannot see relevant infomation

you can use following rule in /root/.htaccess :

rewriteengine on  #if "/document_root/pages/foo" existent file rewritecond %{document_root}/pages/$1 -f #rewrite /foo /pages/foo rewriterule ^(.*)$ /pages/$1 [nc,l] 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -