0

I'm trying to get the following Mod Rewrite to work with no trailing slash as a suffix or file name.

RewriteEngine On
RewriteRule ^test/([^/]*)/([^/]*)/$ /example1/example2/index.php?brand=

$1&video=$2 [L]

The above works however if I remove the trailing slash from /$ it wont work.

So just to recap:

www.example.co.uk/example/example2/index.php?brand=x&video=y

rewrites to

www.example.co.uk/test/brand/video/

but I can't get it working for

www.example.co.uk/test/brand/video

1 Answer 1

0

Try changing the regular expression from ^test/([^/]*)/([^/]*)/$ to ^test/([^/]*)/([^/]*)/?$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.