• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 138
  • Last Modified:

mod_rewrite problem

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
drakkarnoir
Asked:
drakkarnoir
1 Solution
 
mrielfCommented:
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

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now