0

Currently, I can only access links on my Laravel project if they are in the form of domain.com/index.php/somepage. I want to be able to be able to get access with a URL like domain.com/somepage. On my local Windows machine it is working fine. My server is on Ubuntu and running Apache 2.4.6 and the rewrite module was enabled via a2enmod rewrite. My .htaccess is the default one that ships with Laravel:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

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

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

I've also tried the alternate in the Laravel docs both with and without the <IfModule>:

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On

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

I realize this has been asked before but I still can seem to get it working with other examples that I've seen. I'm guessing it must be some Apache configuration that I don't have set.

2
  • You didn't tell what do you want and facing the trouble for ? Commented Mar 8, 2014 at 20:08
  • @SheikhHeera thanks, I added that in. The question has already been answered though. Commented Mar 10, 2014 at 18:26

1 Answer 1

1

Did you make sure that allowoverides all was in your httpd config?

That sounds like your issue.

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

1 Comment

That was it. I just switched the setting in the appropriate directory in my apache2.conf file.

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.