How do I redirect with .htaccess without changing the URL that was typed in? -
currently have [any_name].example.com redirecting example.com/?id=[any_name]
this .htaccess code doing that:
rewritecond %{http_host} !^www\.example.com rewritecond %{http_host} ^(.+).example.com rewriterule ^([^/]*)$ http://example.com/?id=%1 [l,r=301] how can change .htaccess foo.example.com redirects example.com/?id=foo still shows foo.example.com in browser's address bar?
when use r flag, or if include protocol/domain (e.g. http://example.com, mod_rewrite redirect browser instead of internally rewrite request. redirecting browser causes browser load new url, changes url in address bar. want remove have:
rewritecond %{query_string} ^$ rewritecond %{http_host} !^www\.example.com rewritecond %{http_host} ^(.+).example.com rewriterule ^([^/]*)$ /?id=%1 [l,qsa]
Comments
Post a Comment