.htaccess not working on localhost with XAMPP

前端 未结 9 1384
北荒
北荒 2020-11-27 20:49

i m using XAMPP but i m not able to use .htaccess file at local host. i m trying so many times.. Online working good. but local host showing [The requested URL was n

相关标签:
9条回答
  • 2020-11-27 21:43

    Just had a similar issue

    Resolved it by checking in httpd.conf

         # AllowOverride controls what directives may be placed in .htaccess files.
         # It can be "All", "None", or any combination of the keywords:
         #   Options FileInfo AuthConfig Limit
         #
         AllowOverride All   <--- make sure this is not set to "None"
    

    It is worth bearing in mind I tried (from Mark's answer) the "put garbage in the .htaccess" which did give a server error - but even though it was being read, it wasn't being acted on due to no overrides allowed.

    0 讨论(0)
  • 2020-11-27 21:45

    Edit the .htaccess file, so the first line reads 'Test.':

    Test.

    Set the default handler

    DirectoryIndex index.php index.html index.htm

    ...

    0 讨论(0)
  • 2020-11-27 21:46

    In conf/extra/httpd-vhosts.conf, add the line AllowOverride All for all the websites that you are having problem with

    <VirtualHost example.site:80>
        # rest of the stuff
        <Directory "c:\Projects\example.site">
            Require all granted
             AllowOverride All <-----This line is required
        </Directory>
    </VirtualHost>
    
    0 讨论(0)
提交回复
热议问题