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

Hi

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

I am trying to match this:

http://villarentfethiye.simpg.net/17-vacationvillasfethiyerental.html

and send it to:

http://simpg.net/info1.php?a=17

So I am using:

Code: Select all
Options +SymLinksifOwnerMatch
RewriteEngine On

RewriteCond %{HTTP_HOST} ^[.+].simpg.net/[0-9]+-[\.0-9_-a-z]+\.html$ [NC]
RewriteCond %{HTTP_HOST} !^www.simpg.net$ [NC]
RewriteRule ^[\.0-9,-a-z]+\.simpg.net/([0-9]+)-[\.0-9_-a-z]+\.html$ http://simpg.net/info1.php?a=%1 [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:

http://villarentfethiye.simpg.net/

And re-direct to : http://simpg.net/info2.php?a=villarentfethiye

It uses:

Code: Select all
RewriteCond %{HTTP_HOST} ^(.+).simpg.net$ [NC]
RewriteCond %{HTTP_HOST} !^www.simpg.net$ [NC]
RewriteRule ^.*$ http://simpg.net/info2.php?a=%1 [NC,QSA,L]


This second block works - BUT it should not be excepting
any url with data coming after "simpg.net" ... 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 ?

Thanks.


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

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 9 guests

cron