Forum Moderators: phranque
I have four links.
www.url.com/f1/
www.url.com/f1/f2/
www.url.com/f1/f2/f3/
www.url.com/f1/f2/f3/f4/
BUT I want to make folders f2, f3 and f4 virtual with .htaccess.
currently I send all traffic from these pages to a single file: /f1/index.php
That file includes another file depending on the link.
The problem is that all my traffic is going to the single /f1/index.php file.
I want to split my traffic up buy sending all traffic going to /f1/ to a file and all traffic going to /f1/f2/ to a different file, etc. etc.
can anyone solve/understand my question?
How the rewrite rules works is this:
Between the ^ and the $ you insert what you are looking to match so if you have ^f1/$ that rule will match "f1". Then you have file.php which is what will load if the first part matches.
So in the example below when you reach f1/ it will load file.php:
RewriteRule ^f1/$ file.php [L]
RewriteRule ^f1/f2/$ file2.php [L]
RewriteRule ^f1/f2/f3/$ file3.php [L]