views:

16

answers:

1

I have site with these files and foldes:

/index.php ( that include php files contained in folder1 and folder2 )
/config.php
/folder1/
/folder2/

I want this:

when a user point to any folder ( folder1, folder2 or any other folder ) then he is redirected to index.php

How could I do that ?

A: 

You want mod_rewrite. For example, to forward any request to any alphanumerically-named folder to index.php, passing the name of the folder as the GET parameter folder, use something like:

RewriteEngine on
RewriteRule ^([A-Za-z0-9]+)/?$ index.php?folder=$1
Dominic Rodger