0

so I was asked to deploy an out-of-the-box laravel project done by other developer. It uses laravel 5, and is set up in IIS Manager.

Now we are doing some features upgrading of the website and I want to run this website on my localhost. I am using XAMPP.

I have copied the whole folder from the live web server and done the database configuration perfectly.

Now, I can view the homepage with no problem.

FYI, the folder structure is like this

C:/xampp/htdocs/myproject/
-app
-aspnet_client
-bootstrap
-config
-css
-database
-images
-js
-logs
-resources
-storage
-tests
-touchtouch
-vendor
.htaccess
index.php
package.json
server.php
...

Now, I can run "localhost/myproject" and load the homepage perfectly, but when I run this link e.g localhost/myproject/aboutus, it says

Sorry, the page you are looking for could not be found.
NotFoundHttpException in RouteCollection.php line 145:

while if I run this localhost/index.php/aboutus it loads perfectly.

my htaccess is:

php_flag xcache.cacher 0
<IfModule mod_rewrite.c> 
<IfModule mod_negotiation.c> 
    Options -MultiViews 
</IfModule>  
Options +FollowSymLinks 
RewriteEngine On 
RewriteBase /MyProject/ 
# Redirect Trailing Slashes... 
 RewriteRule ^(.*)$index.php /$1  [L,R=301]  
# Handle Front Controller... 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^ index.php [L] 
</IfModule>

My config/app.php url is "http://localhost" if this matters.

and I have turned on the LoadModule rewrite_module modules/mod_rewrite.so

am I missing anything? thank you for your help.

user2960754
  • 233
  • 1
  • 2
  • 16
  • You need to import your `.htaccess` rules to IIS as per this answer http://stackoverflow.com/questions/15018538/laravel-htaccess-rewrite-rule-convertion-to-iis – Wader Jun 02 '15 at 08:03
  • @Wader hi, i'm migrating the Live version to my localhost. not the other way round thank you – user2960754 Jun 02 '15 at 11:44

1 Answers1

1

I have fixed it. the problem lies on the RewriteBase; my real folder was MyProject, and I just renamed it to all small letter and it now works like charm.

I changed my .htaccess

php_flag xcache.cacher 0
<IfModule mod_rewrite.c> 
<IfModule mod_negotiation.c> 
    Options -MultiViews 
</IfModule> 
RewriteEngine On 
RewriteBase /myproject/

# Redirect Trailing Slashes... 
RewriteRule ^(.*)/$/$1 [L,R=301] 


# Handle Front Controller... 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^ index.php [L] 
</IfModule>
user2960754
  • 233
  • 1
  • 2
  • 16