Hacienda Misne
Hacienda Misne

Reputation: 1

mod_rewrite virtual directories without variables

I haven't come up with a solution for this. I want to have multiple virtual directories but cant find how to do it without using PHP or some sort of variables. For example I want:

mysite.com/restaurant/ to point to mysite.com/restaurant.php

mysite.com/restaurant/menu/ to point to mysite.com/restaurant-menu.php
mysite.com/restaurant/location/ to point to mysite.com/restaurant-location.php

And so on, there is no dynamic content; I have all the files.

Upvotes: 0

Views: 732

Answers (1)

undone
undone

Reputation: 7888

you can use mod_rewrite to do that!

RewriteEngine on
RewriteRule ^restaurant/?$  restaurant.php [L]
RewriteRule ^restaurant/menu/?$  restaurant-menu.php [L]
RewriteRule ^restaurant/location/?$  restaurant-location.php [L]

Upvotes: 2

Related Questions