php - HTACCESS - Setting root folder as public_html -
so, i'm writing .htaccess file, , i've stumbled upon issue of root folders. currently, http://localhost/public_html/index root of website. want have url http://localhost/index instead.
i know pretty simple, of posts have looked @ far have not proven work. here have far, producing 404 error.
rewriteengine on  rewritecond ${request_filename} !-f rewriterule ^([^\.]+)$ $1.php [nc,l]  rewritecond %{request_uri} !^/public_html/ rewriterule ^(.*)$ /public_html/$1 [qsa]   please include documentation or guides .htaccess if possible. thanks.
the following .htaccess code can added achieve results wanted:
rewriteengine on  rewritecond %{request_uri} !public_html/ rewriterule (.*) /public_html/$1 [l]      
Comments
Post a Comment