Ahsous
Ahsous

Reputation: 125

mod_rewrite without creating subfolders

i'm trying to get my rewrite rules working, so that /stream/file.mp4 redirects to /stream.php?f=file.mp4. However this only works when i create a folder named stream. What am I doing wrong?

RewriteEngine on 
RewriteBase /
RewriteRule ^stream/(.*)$ /stream.php?f=$1
RewriteRule ^(.*)\.html$ $1.php

Upvotes: 1

Views: 20

Answers (1)

anubhava
anubhava

Reputation: 785561

Try this code in root .htaccess with MultiViews disabled:

Options -MultiViews
RewriteEngine on 
RewriteBase /

RewriteRule ^stream/(.+)$ stream.php?f=$1 [L,QSA,NC]

RewriteRule ^(.+?)\.html$ $1.php [L,NC]

Upvotes: 1

Related Questions