Rewrite rule for any file name to index page

Using mod_rewrite to handle various content issues

Rewrite rule for any file name to index page

Postby Pramod » Fri Jan 07, 2005 12:26 am

Hi,
I want to redirect all the request in a particular directory to index page of that directory. Eg. If some one request for

http://www.mysite.com/mydirectory/abc.gif

Index page of directory should be called & abc.gif should be sent as
http://www.mysite.com/mydirectory/index.php3?pic=abc.gif

Please help me.

Thanks
Pramod
Pramod
 

Postby Caterham » Fri Jan 07, 2005 8:07 am

Place this code in a .htaccess in your folder mydirectory
Code: Select all
RewriteEngine On
RewriteRule !^index.php3 - [C]
RewriteRule ^(.*) index.php3?pic=$1 [L]


This should rewrite everything within that folder exept index.php3 to index.php2?pig=origRequest

Bob
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Rewrite rule for any file name to index page

Postby Pramod » Mon Jan 10, 2005 4:51 am

Thanks Bob,
Thanks a lot for your cooperation,

Pramod :D
Pramod
 


Return to Content

Who is online

Users browsing this forum: No registered users and 12 guests

cron