need help to optimize an existing mod_rewrite

need help to optimize an existing mod_rewrite

am 30.05.2007 04:17:59 von eithkhad

Hello!

I am new to Mod Rewrite, I have an existing code and I need to
customize it.

ACTUAL SITUATION (works perfectly)
Here is the .htaccess code (source: zenphoto)

Code:

# htaccess file

RewriteEngine On

# web path
RewriteBase /

RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule ^.*$ - [R,L]

RewriteRule ^page/([0-9]+)/?$ index.php?page=$1 [L,QSA]
RewriteRule ^page/([A-Za-z0-9\-_]+)/?$ index.php?p=$1 [L,QSA]
RewriteRule ^([^/]+)/?$ index.php?album=$1 [L,QSA]
RewriteRule ^([^/]+)/page/([0-9]+)/?$ index.php?album=$1&page=$2
[L,QSA]
RewriteRule ^([^/]+)/image/(thumb|[0-9]{1,4})/([^/\\]+)$ data/i.php?
a=$1&i=$3&s=$2 [L,QSA]
RewriteRule ^([^/]+)/image/([^/\\]+)$ albums/$1/$2 [L]
RewriteRule ^([^/]+)/([^/\\]+)$ index.php?album=$1&image=$2
[L,QSA]


With this code above, it allow me for each time, I request a filename
the address to display this following address:

site.com/albumname/filename.flv

instead of this:
site.com/albums/albumname/filename.flv

So now I have two questions:

1. How is it possible for me to display this:

EXAMPLE:
Instead of this:
site.com/oneday/cook-chinese.flv

I want this to be displayed:
site.com/cook-chinese/in-oneday/

How is it possible to make that?

2. How is it possible for me to not allow anyone to download directly
the FLV file?
I need to protect my FLV files since I took time to produce each
videos.

How is it possible to make that?


Thank you SO much in advance for your answers.