View Full Version : rewriterule not keeping url structure

09-01-2011, 08:36 PM
My RewriteRule is working in the sense of passing the variables, but it is not keeping the URL structure. It is changing it to the second half of the rule in the URL...

RewriteRule ^computer-store/([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$ http://www.example.com/computer-store/?title=$1&_action=$2&id=$3&parent=$4 [L]

Example Link:


Again, the link works in passing the variables, and the page gives me the proper results, but the URL after clicking the link is the following:


09-02-2011, 12:05 AM
1. This has nothing to do with PHP.
2. It matches and performs perfectly for what you have provided. So what is the problem again?

Rewriting works only one way, and that is Apache -> processor. When you create a link and provide it as a querystring, that is what you will get; rewrite will not rewrite the links on your web page.