0

I have an application using Laravel 4. And I modfied the .htaccess file so I can redirect mydomain.com to www.mydomain.com. Here is the .htaccess file:

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On

    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

</IfModule>

When I go to a route like mydomain.com/account/create all works fine, but when I go to mydomain.com/index.php/account/create I get a file not found error. Can someone point me in the right direction? Thanks!

3
  • Is your setup able to handle path info? Does going to mydomain.com/index.php?/account/create work? Commented Dec 4, 2013 at 10:49
  • This will redirect me to homepage. Commented Dec 4, 2013 at 10:52
  • Do you get a laravel 'file not found' error - or a server 'file not found' error? Commented Dec 4, 2013 at 12:20

1 Answer 1

2

It is not working - because laravel is not designed to have index.php in your route.

I'm guessing you are coming from the old Codeigniter days when some sites still have index.php in their route - but this is a different routing system.

Just use the normal routes.

Sign up to request clarification or add additional context in comments.

1 Comment

This is strange, because in my local environment was working. Altough I don't intend to use like this. I made a .htaccess fix for this.

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.