ya, It works, but it's not was i expected. for example my own blog * rodmena.ourway.ir* <http://rodmena.ourway.ir> now redirects to it's correct path, but i wanted to stay at sub domain level while surfing. my code is simple:
#==== Blogs subdomain redirection ======= host_parts = request.env.http_host.split('.') if len(host_parts) == 3: subdomain = host_parts[0] main_domain = '%s.%s' % (host_parts[1], host_parts[2]) red_link = '%s://%s/pages/blog?u=%s' % (request.env.wsgi_url_scheme, main_domain, subdomain) redirect(red_link) #======================================== Btw, thx all for their answer, but i still need to solve it in routes.