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.

2
  • You need to import your .htaccess rules to IIS as per this answer stackoverflow.com/questions/15018538/… Commented Jun 2, 2015 at 8:03
  • @Wader hi, i'm migrating the Live version to my localhost. not the other way round thank you Commented Jun 2, 2015 at 11:44

1 Answer 1

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.