php - htaccess alias use - load/get file from other directory -


we use index of 1 directory generate content in other (fake) directories. searching here , everywhere on week didn't give working results. .htaccess alias directive should it, can't seem working. here's case:

this main dir , file content loads database:

/news/index.php 

these navigation links should load index.php /news, cat id's (this have working):

/animal-news/cat=1 /car-news/cat=2 /music-news/cat=3 

so these 3 dirs exist (or rather not if possible), , content loaded /news/index.php.

so far came (the url should same though: ie: /animal-news/cat=1/)

alias /animal-news/cat=1/ /news/index.php?cat=1/ 

anyhelp highly appreciated! thanks!

alias isn't allowed in .htaccess, need use mod_rewrite rules.

enable mod_rewrite , .htaccess through httpd.conf , put code in .htaccess under document_root directory:

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase /  rewriterule ^[^/]+/([^=]+=[0-9]+)/?$ /news/index.php?$1 [l,qsa] 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -