wordpress - .htaccess silent root to subdirectory remap -
i need remap root domain requests subfolder silently except /user/
, /admin/
. have custom code under root domain , want install wordpress additionally should available under root domain.
my htaccess looks this:
options followsymlinks rewriteengine on rewritebase / setenvif request_uri ^(.*)$ section=public setenvif request_uri ^/user/.*$ section=user setenvif request_uri ^/admin/.*$ section=admin # link wordpress rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{env:section} public # ... how map subdirectory here? ... #
update
i came accross next code working need it, if file not exists in wordpress, repoints code.
# link public wordpress rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{env:section} public rewritecond %{request_uri} !^/wordpress/ rewriterule ^(.*)$ /wordpress/$1 # link public wordpress root folder rewritecond %{env:section} public rewriterule ^(/)?$ wordpress/index.php [l]
you can place rule below rewritebase
line skip 2 directories rules:
rewriterule ^(user|admin)(/.*)?$ - [nc,l]
wordpress .htaccess redirect
No comments:
Post a Comment