Solved

mod_rewrite problem

Posted on 2004-10-31
133 Views
Last Modified: 2010-03-04
Ok, right now, I have the following:

RewriteRule ^articles/([0-9]+)/?$ /index.php?page=articles&id=$1

Works just fine, but the problem is, all my HREF's come out to:

http://www.domain.com/?page=blah

It should be:

http://www.domain.com/index.php?page=blah

They are missing the actual "index.php" in HREF's, is there a way to change the pattern to include that?
0
Question by:drakkarnoir
    1 Comment
     
    LVL 5

    Accepted Solution

    by:
    Use this if you want to convert http://yoursite.com/articles/123/ to http://yoursite.com/index.php?page=articles&id=123

    RewriteEngine on
    RewriteRule ^/articles/([0-9]+)/$ /index.php?page=articles$id=$1 [R]

    use [R] to tell to browser that document moved...
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Shellfire Box VPN + Lifetime Subscription

    The Shellfire Box easily connects all of your devices, even those that don't offer the possibility to establish a safe vpn connection. Access blocked content and surf safely, no matter where in the world you are located.

    If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
    Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
    This video discusses moving either the default database or any database to a new volume.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    857 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

    16 Experts available now in Live!

    Get 1:1 Help Now