views:

19

answers:

1

Hello, I have this code in my .htaccess:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\+apple\+fruit/$ ?q=$1 [L]

this turns the searchquery in /keyword+apple+fruit/

thats ok.. the only problem is, if I type in /keyword+apple+fruit +any+text+haha+ apple+fruit/ the htacces is showing content - but I don't want that.

is there any command to say - ok apple + fruit only one time in the url and the second time send a 404 or show nothing..

thank you!!

A: 

You can use a RewriteCond to exclude such a case:

RewriteCond $1 !apple\+fruit
RewriteRule ^(.*)\+apple\+fruit/$ ?q=$1 [L]
Gumbo
oh thank you soooo much gumbo!!! thank you!!!!!
elmaso