404 Not Found The requested URL was not found on this server

前端 未结 9 2210
误落风尘
误落风尘 2020-12-25 14:49

I\'m having small troubles and was wondering if someone can help me over the hump. I pulled a copy of a website down from Hostgator and I\'m trying to set it up on my local

相关标签:
9条回答
  • 2020-12-25 15:12

    In Ubuntu I did not found httpd.conf, It may not exit longer now. Edit in apache2.conf file working for me.

    cd /etc/apache2
    sudo gedit apache2.conf
    

    Here in apache2.conf change

    <Directory /var/www/>
         Options Indexes FollowSymLinks
         AllowOverride None
         Require all granted
    </Directory>
    

    to

    <Directory /var/www/>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
    </Directory>  
    
    0 讨论(0)
  • 2020-12-25 15:14

    If your .htaccess file is ok and the problem persist try to make the AllowOverride directive enabled in your httpd.conf. If the AllowOverride directive is set to None in your Apache httpd.config file, then .htaccess files are completely ignored. Example of enabled AllowOverride directive in httpd.config:

     <Directory />
        Options FollowSymLinks
        **AllowOverride All**
     </Directory>
    

    Therefor restart your server.

    0 讨论(0)
  • 2020-12-25 15:16

    In my case (running the server locally on windows) I needed to clean the cache after changing the httpd.conf file.

    \modules\apache\bin> ./htcacheclean.exe -t
    
    0 讨论(0)
  • 2020-12-25 15:23

    For saving a file as .htaccess, when using windows, you have to open notepad and then saveas .htaccess as windows does not create files starting with a dot. That should get your .htaccess working and it'll clear up the issue.

    By the way, in order to receive specific error messages set Configure::write('debug', 0); to '2' in app/config/core.php for development purposes.

    0 讨论(0)
  • 2020-12-25 15:24

    Just solved this problem! I know the question is quite old, but I just had this same problem and none of the answers above helped to solve it.

    Assuming the actual domain name you want to use is specified in your c:\windows\System32\drivers\etc\hosts and your configurations in apache\conf\httpd.conf and apache\conf\extra\httpd-vhots.conf are right, your problem might be the same as mine:

    In Apache's htdocs directory I had a shortcut linking to the actual project I wanted to see in the browser. It turns out, Apache doesn't understand shortcuts. My solution was to create a proper symlink:

    In windows, and within the httdocs directory, I ran this command in the terminal:

    mklink /d ple <your project directory with index.html> 
    

    This created a proper symlink in the httpdocs directory. After restarting the Apache service and then reloading the page, I was able to see my website up :)

    0 讨论(0)
  • 2020-12-25 15:28

    In httpd.conf file you need to remove #

    #LoadModule rewrite_module modules/mod_rewrite.so
    

    after removing # line will look like this:

    LoadModule rewrite_module modules/mod_rewrite.so
    

    I am sure your issue will be solved...

    0 讨论(0)
提交回复
热议问题