redirect http://domainname.de to http://www.domainname.de
Posted: Sun 6. Apr 2008, 12:39
Hi everrybody,
i have the following problem. im using the rewrite engine so that URLs like index.php?bla are being transformed into bla.phtml.
thats great. but i also wanted to redirect all URLs without www in it to the one with www in it, for example:
http://domainname.de to http://www.domainname.de
Therefore i included the following code in my htaccess:
RewriteCond %{HTTP_HOST} domainname\.de$
RewriteCond %{HTTP_HOST} !www\.domainname\.de$
RewriteRule ^(.*)$ http://www.domainname.de/$1 [L,R=301]
Now that works perfectly for the index page:
http://domainname.de to http://www.domainname.de
But other pages like http://domainname.de/bla.phtml are being redirected to http://www.domainname.de/index.php?bla and not http://www.domainname.de/bla.phtml
How can i manage that? Anyone an idea?
Thanks, gurke
i have the following problem. im using the rewrite engine so that URLs like index.php?bla are being transformed into bla.phtml.
thats great. but i also wanted to redirect all URLs without www in it to the one with www in it, for example:
http://domainname.de to http://www.domainname.de
Therefore i included the following code in my htaccess:
RewriteCond %{HTTP_HOST} domainname\.de$
RewriteCond %{HTTP_HOST} !www\.domainname\.de$
RewriteRule ^(.*)$ http://www.domainname.de/$1 [L,R=301]
Now that works perfectly for the index page:
http://domainname.de to http://www.domainname.de
But other pages like http://domainname.de/bla.phtml are being redirected to http://www.domainname.de/index.php?bla and not http://www.domainname.de/bla.phtml
How can i manage that? Anyone an idea?
Thanks, gurke