Is it possible to have dynamic RewriteBase on .hta

2019-08-26 09:34发布

问题:

I made a CodeIgniter based website. I write a .htaccess as suggested in http://codeigniter.com/wiki/mod_rewrite

Since I put my web directory in public_html/ci_try, It is necessary to change

RewriteBase /

into

RewriteBase /ci_try

But, everytime I change the location, I should edit htacess. Is there a way to make such a "dynamic rewrite-base" or other way so that I don't need to repeat my self editing htaccess?

UPDATE : For now I use php to generate htaccess. But I want to know if there is a better solution out there to be accepted