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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.