php - mod_rewrite domain to directory -


i want rewrite example.com url example.com/ru

for example if url example.com/books want have example.com/ru/books

i think can't header() function

this method incorrect

<meta http-equiv="refresh" content="1; url=http://www.example.com/ru"> 

you should edit .htaccess redirect user queries @ / level new /ru/ level. should work purpose:

rewriteengine on rewritecond %{request_uri} !^/ru/ rewriterule ^(.*)$ /ru/$1 [l,r=301] 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -