Rewrite rule causing navigation issues

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Rewrite rule causing navigation issues

Post by social_experiment »

I have this rewrite rule
[text]
RewriteRule ^console/sales_view/([0-9]+)$ console/sales_view.php?s=$1
[/text]

It works for the innitial page (of pagination) but once I navigate to the next page, the content is still displayed, but without styling and the url looks like this

[text]
http://localhost/cms/console/sales_view/sales_view/5
[/text]

Below is the complete htaccess content

[text]
RewriteEngine on
RewriteRule ^front-end/product/([0-9]+)$ front-end/product.php?id=$1
RewriteRule ^console/sale_single_view/([0-9]+)$ console/sale_single_view.php?id=$1
RewriteRule ^console/sales_view/([0-9]+)$ console/sales_view.php?s=$1/
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
[/text]
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Rewrite rule causing navigation issues

Post by Celauran »

You need [L] at the end of the rewrite rule to tell it to stop processing further rules.
Post Reply