.htaccess - Implementing MediaWiki Short Url example.com/Main_Page while still giving access to robots.txt -
for following .htaccess how allow access robots.txt?
rewriteengine on rewritecond %{http_host} ^www\.(.+)$ [nc] rewriterule ^[^:]*\. - [l] rewriterule ^[^:]*\/ - [l] rewriterule ^/*$ /w/index.php?title=main_page [l,qsa] rewriterule ^(.+)$ /w/index.php?title=$1 [l,qsa]
generally, mod_rewrite, check if file exists, , if does, not go somewhere else.
after initial rewritecond, add
rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d
only if file or directory not exist name requested, continue on rewriterule's.
Comments
Post a Comment