Jump to content

mod_rewrite help, please


EvanAgee

Recommended Posts

Greetings,

 

I've got several rules below. The problem is that even after it has applied one of the rules higher in the list it continues to apply the rules further down the list. What I'm looking for is for a rule to be applied and then for it to quit comparing the URL to the rules.

 

RewriteEngine on

RewriteRule ^print/$ /lib/cjprinterfriendlyv2/printpage.php

 

Options FollowSymlinks

RewriteRule ^make_offer/(\d+) /?action=make_offer&p=$1

RewriteRule ^blog(/|)$ /?action=blog

RewriteRule ^blog/(.+)$ /?p=$1

RewriteRule ^tags/(.+)$ /?tag=$1 [QSA]

RewriteRule ^asset/(.+)/(\d+)(|/)$ /?asset=$1&id=$2

RewriteRule ^video/(\d+)(|/)$ /?asset=video&id=$1

RewriteRule ^asset/video/(.+)(\.php|\.html|\.htm)$ /?asset=video&file_name=$1

RewriteRule ^video/(.+)(\.php|\.html|\.htm)$ /?asset=video&file_name=$1

RewriteRule ^tags/$ /?tag=INDEX

RewriteRule ^presearch/$ /?action=presearch [QSA]

RewriteRule ^search/(.*)/(|pages|images|videos)$ /?action=search&s=$1&t=$2

RewriteRule ^sitemap/$ /?action=sitemap

RewriteRule ^sitemap/(image|video)(&p=(\d+)|)$ /?action=sitemap&m=$1&p=$3

RewriteRule ^ecommerce-videos-movies/$ /?action=sitemap&m=video

RewriteRule ^ecommerce-images-photos/$ /?action=sitemap&m=image

RewriteRule ^email_this_page/(\d+)(|/)$ /?action=email_page&pid=$1

RewriteRule ^email_this_page/asset/(\d+)(|/)$ /?action=email_page&&is_asset=true&aid=$1

 

RewriteRule ^(.+)(\.php|\.html|\.htm|\/)$ /?p=$1$2 [QSA]

 

The last rule should only apply to queries NOT matching the rules above, sort of a catch all rule. How can I achieve this?

Link to comment
https://forums.phpfreaks.com/topic/130002-mod_rewrite-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.