Hey All, a question about mod-rewrite. When user inputs
/somepage?ln=xx my server loads invisibly
/xx/somepage which is much a beautiful url.
BUT, those ugly pages still reappear cached and i just wish them to permanently redirect to the nice urls. so they would disappear and only beautifull urls would remain.
/somepage?ln=xx should permanently 301 redirect to
/xx/somepage which then would load invisibly the page without showing ugly url. When no language is set, assume english:
/somepage should redirect to
In both cases,the file extension should be optional (e.g. should work with and without various extensions) .php .htm .pag, in other words all 3-char-extensions should work too, if those urls have them).
/contact?ln=xx or /contact.zzz?ln=xx
should go both to /xx/contact
language is only 2-chars. What i now have:
# make language as a /lang/page like /xx/contact WORKS RewriteRule ^([a-z][a-z])/(.*) /$2?ln=$1 [L] # when no page, only language set, go to root /nl or /nl/ WORKS RewriteRule ^([a-z][a-z])/?$ /$1/home [R=301,L] # permanently redirect ugly urls to nice ones, so the ugly ones dissappear RewriteRule ???