apache - htaccess if parameter doesn't exists -


i have problem htaccess redirection. on site use url language parameters (yes there 2 - lang , country) this

www.domain.com/en/spain/ 

i trying redirect [301] default language if user come direct link

www.domain.com => www.domain.com/en/global example 

i use redirecting none www link.

rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/en/global/$1 [r=301,l] 

thank you.

try this:

rewritecond %{http_host} !^www\. rewriterule ^/?$ http://www.example.com/en/global/ [r=301,l]  

this redirects

   example.com 

to

www.example.com/en/global/ 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -