views:

30

answers:

3
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^browse/videos/(.*)/(.*)/(.*)/(.*) /videos.php?sortby=$1&filter=$2&page=$3&title=$4
RewriteRule ^videos/(.*)/(.*) /playvideo.php?videoid=$1&title=$2
</IfModule>

url www.example.com/browse/videos/z/0/1/LastAdded goes to videos.php

but url www.exaple.com/videos/10/play.html also goes to videos.php not to playvideo.php

Why?

A: 

Not sure why that is hapenning to you but anyway you should be using something like this.

RewriteRule ^browse/videos/(.+)/(.+)/(.+)/(.+) /videos.php?sortby=$1&filter=$2&page=$3&title=$4 [L]
RewriteRule ^videos/(.+)/(.+) /playvideo.php?videoid=$1&title=$2 [L]
frisco
A: 

This could be caused by MultiViews. Try to disable it with:

Options -MultiViews

Furthermore, you should use more specific pattern than .*, for example [^/]+:

RewriteRule ^browse/videos/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /videos.php?sortby=$1&filter=$2&page=$3&title=$4
RewriteRule ^videos/([^/]+)/([^/]+)$ /playvideo.php?videoid=$1&title=$2
Gumbo
I found <Directory /var/www/> Options Indexes FollowSymLinks MultiViews [...]</Directory>after deleting MultViews everything works ok.Thanks!
DreamCatch
@user464492: You’re welcome!
Gumbo
A: 

It works for me. To track down why it doesn't work for you, you should enable mod_rewrite logging:

RewriteLogLevel 9
RewriteLog logs/rewrite.log

Then you should try to understand what's written there. And if you don't understand it, post it here and we will try to explain it.

Roland Illig
after deleting MultViews in Options everything works ok
DreamCatch