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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -