correct pretty URLs in .htaccess Apache

Posted on 2014-08-05
Last Modified: 2014-08-20

I have this URL:

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

I added some code but this URL doesn't work:

But this funny-looking URL works though:

So I know the program is working but how I can fix it so the URL works:

Just fyi, I was reading this page under the "Routing" section and just added that small tidbit of code:

I have this in my .htaccess file:

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

    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]

Open in new window

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

Thank you and Father bless<><
Question by:Victor Kimura
    LVL 14

    Assisted Solution

    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

    Author Comment

    by:Victor Kimura
    @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.
    LVL 14

    Accepted Solution

    as i do not understand your talk about frameworks and youtube which is absolutely irrelevant in your problem.
    try this

    Author Comment

    by:Victor Kimura
    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<><

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now