Please Help. Tried - but this just isn't working

New to mod_rewrite? This is a good place to start.

Please Help. Tried - but this just isn't working

Postby krekki » Sat Feb 02, 2013 6:23 am


I have gone over and over this but I can not get it to work.

I am trying to match this:

and send it to:

So I am using:

Code: Select all
Options +SymLinksifOwnerMatch
RewriteEngine On

RewriteCond %{HTTP_HOST} ^[.+][0-9]+-[\.0-9_-a-z]+\.html$ [NC]
RewriteCond %{HTTP_HOST} !^$ [NC]
RewriteRule ^[\.0-9,-a-z]+\[0-9]+)-[\.0-9_-a-z]+\.html$ [NC,QSA,L]

But it is not working.

Because this first block is not catching the incoming url,
my second block gets it and sends it to the wrong page.

My second block should only match:

And re-direct to :

It uses:

Code: Select all
RewriteCond %{HTTP_HOST} ^(.+)$ [NC]
RewriteCond %{HTTP_HOST} !^$ [NC]
RewriteRule ^.*$ [NC,QSA,L]

This second block works - BUT it should not be excepting
any url with data coming after "" ... but it does.

Because when the first block fails, the second is doing
a re-direct ( but to the wrong page )

Can anyone see where I have gone wrong ?


Posts: 60
Joined: Sat Aug 19, 2006 11:47 am

Return to Beginner's Corner

Who is online

Users browsing this forum: Google [Bot] and 12 guests