1

I've installed new laravel project on a local server and encountered problem that the simple demo routes with "Hello" view was not working, returning 404 error. After I copy/pasted .htaccess file from another project, routes started to work, but could not access public folder with css styles. How are files like routes.php or public folder connected/called? It is the responsibility of .htacces file?

--

What if hosting server doesnt support .htaccess? Can laravel app run on such servers?

Axel Stone
  • 1,521
  • 4
  • 23
  • 43
  • 1
    No the .htaccess simply routes all the urls to the index.php file which basically starts the application (and later includes the routes.php) So without the .htaccess when you enter `/hello` it the server is searching for a subdirectory with the name hello – lukasgeiter Nov 08 '14 at 11:24
  • Then what exactly should be in .htaccess file to route all urls to index.php – Axel Stone Nov 08 '14 at 12:29
  • [Here](https://github.com/laravel/laravel/blob/master/public/.htaccess)'s the one that comes with a default installation – lukasgeiter Nov 08 '14 at 12:31
  • Sometimes this kind of error for copy/pasted not working htaccess, when used FTP to send files, is related to the transmission of the file. Yous need to use text mode and not binary. And ftp softwares don't always know .htacces text files... – Croises Nov 08 '14 at 14:21
  • Does it mean that hosting server must provide Mod_rewrite mode? – Axel Stone Nov 09 '14 at 18:46

0 Answers0