correct pretty URLs in .htaccess Apache

Hi,

I have this URL:
http://localhost/test/trunk/php/l4/public/index.php

and it works fine. I'm using Laravel 4 btw.

I added some code but this URL doesn't work:
http://localhost/test/trunk/php/l4/public/users

But this funny-looking URL works though:
http://localhost/test/trunk/php/l4/public/index.php/users

So I know the program is working but how I can fix it so the URL works:
http://localhost/test/trunk/php/l4/public/users

Just fyi, I was reading this page under the "Routing" section and just added that small tidbit of code:
http://laravel.com/docs/quick#installation

I have this in my .htaccess file:

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

    RewriteEngine On
    RewriteBase /

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

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

Open in new window


How can I fix it to make this work in .htaccess?

Thank you and Father bless<><
Victor KimuraSEO, Web DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

theruckCommented:
you do not need a rewrite rule for the http://localhost/test/trunk/php/l4/public/users url to work if there is an index page in the public folder. just comment out the RewriteRule ^ index.php [L] and see
if there is a specific URL you need the /users URL to redirect. please post it here
0
Victor KimuraSEO, Web DeveloperAuthor Commented:
@theruck, if I comment out the RewriteRule then don't I need to comment out the RewriteCond's too since it's the rule based on the previous conditions and it's the last rule?

It's the Lararel framework so there is no public/users folder. I don't know the inner workings of the framework but it's supposed to work. The youtube videos I've seen have used a Vagrant box for it so maybe it'll work then.
0
theruckCommented:
as i do not understand your talk about frameworks and youtube which is absolutely irrelevant in your problem.
try this
http://www.generateit.net/mod-rewrite/index.php
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Victor KimuraSEO, Web DeveloperAuthor Commented:
Also, what worked for me was that I had to enable the mod_rewrite in Apache because by default it's not enabled for WAMP which is odd I think since it's so widely used. But then I had to restart my computer or log out and then log back in again because it's tied to the Windows session. Hope this helps others too. Father God bless<><
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.