简体   繁体   中英

.htaccess blocking me from view index.html

So I have this .htaccess file which loads a PHP to echo something out. But whenever I access my domain(www.domain.com) it doesn't load at all even though I made an index.html. If I access via domain.com/index.html, it loads the index fine. This is the .htaccess file:

RewriteEngine On
RewriteCond %{QUERY_STRING}} nocache=true [OR]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mediaserver.php?f=$1 [L]

Any help is appreciated.

  1. You need DirectoryIndex line at the top
  2. You seem to have a syntax issue with your rule as you have 2 }}

Try this:

DirectoryIndex index.html

RewriteEngine On
RewriteCond %{QUERY_STRING} nocache=true [OR]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ mediaserver.php?f=$1 [L,QSA]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM