Apache Server configuration support - need help to optimize an existing mod_rewrite

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > May 2007 > need help to optimize an existing mod_rewrite





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author need help to optimize an existing mod_rewrite
eithkhad

2007-05-30, 1:25 am

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
<IfModule mod_rewrite.c>
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.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com