apache - .htaccess dynamic variables from php? -
i'm trying find way dynamically change root folder of site. set root folder following:
rewritecond %{document_root}/foo/bar%{request_uri} -f rewriterule ^(.*)$ %{document_root}/foo/bar%{request_uri} [qsa,l]
so if user visits http://example.com it's pulling /foo/bar. able change /foo/bar other random directory of choosing php.
this done because root folder of site can changed quite regularly various reasons.
i write php script replace /foo/bar in .htaccess file that's not wise decision give php write access .htaccess. ideally have simple .txt file can included pull in /foo/bar , php can write .txt file.
is possible, or there other way done? thing matters php can safely change root folder without apache restart.
you might want rewritemap
, actually, i'd make symlink, , point proper place.
Comments
Post a Comment