Monday, 19 August 2013

htaccess alias use - load/get file from other directory

htaccess alias use - load/get file from other directory

We would like to use the index of one directory to generate content in
other (fake) directories. Searching here and everywhere for over a week
didn't give any working results. The .htaccess Alias directive should do
it, but we just can't seem to get it working. Here's the case:
This is the main dir and file where content loads from a database:
/news/index.php
These navigation links should load the index.php from /news, but with the
cat ID's (this we have working):
/animal-news/cat=1
/car-news/cat=2
/music-news/cat=3
So these three dirs do exist (or rather not if possible), and the content
is loaded from /news/index.php.
So far this is what we came up with (the url should be the same though:
ie: /animal-news/cat=1/)
Alias /animal-news/cat=1/ /news/index.php?cat=1/
Anyhelp is highly appreciated! Thanks!

No comments:

Post a Comment