Jump to content


301 Weiterleitung


5 replies to this topic

#1 oleolson

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 14 October 2007 - 04:07 PM

Hallo zusammen,

ich habe bis jetzt immer die englische Abteilung genutzt, finde aber, dass das deutsche Board ruhig ein wenig Bewegung mehr vertragen kann.
Meine Frage:

Kennt sich jemand mit htaccess-files aus?
Ich benutze die mitgelieferte Version des htaccess will aber zusätzlich von domain.com auf www.domain.com umleiten.
Kann mir da jemand helfen?

Gruß ole

Edited by oleolson, 14 October 2007 - 04:08 PM.


#2 Ed Headset

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 191 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Etomite, PHP, Ajax.
    3D imaging

Posted 14 October 2007 - 05:42 PM

Hallo Ole,

Mein Deutsch is sehr slecht, Ich hoffe das du verstehed dat ich mein antword in Englisch schreibe:

Hi Ole, My German is very bad, so I hope you understand I'll write this in English.

Your website can be accessed with www.domain.com and domain.com.
But you want to reroute all traffic to www.donmain.com

Solution:
Do a 301 redirect for all http requests that are going to the wrong url.
use in you .httaccess file:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

This will translate all incomming traffic to www.domain.com, with a 301 redirect.
This means a permanent reroute, and will be updates in search engines.
I hope this is the answer to your question.

Viele Grussen ;)





View Postoleolson, on Oct 14 2007, 07:07 PM, said:

Hallo zusammen,

ich habe bis jetzt immer die englische Abteilung genutzt, finde aber, dass das deutsche Board ruhig ein wenig Bewegung mehr vertragen kann.
Meine Frage:

Kennt sich jemand mit htaccess-files aus?
Ich benutze die mitgelieferte Version des htaccess will aber zusätzlich von domain.com auf www.domain.com umleiten.
Kann mir da jemand helfen?

Gruß ole

Edited by Ed Headset, 14 October 2007 - 05:43 PM.


#3 Dean

    Loves Etomite Forums!

  • Admin
  • 4,744 posts
  • Gender:Male

Posted 14 October 2007 - 10:55 PM

Hi Ed,
how will this interfere with Etomite's built in rules?

Rgds,
Dean

#4 oleolson

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 15 October 2007 - 04:37 AM

Hallo Ed Headset, hallo Dean,


das ist die aktuelle htaccess. Wenn ich die beiden Zeilen dazu packe, ergibt das einen 500-Internal Server Error.

(adding your lines to my htaccess will affect a server error...)

RewriteEngine On
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

AddDefaultCharset Off

any suggestions?

Gruß Ole

#5 Ed Headset

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 191 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Etomite, PHP, Ajax.
    3D imaging

Posted 20 October 2007 - 07:51 PM

View Postoleolson, on Oct 15 2007, 07:37 AM, said:

Hallo Ed Headset, hallo Dean,


das ist die aktuelle htaccess. Wenn ich die beiden Zeilen dazu packe, ergibt das einen 500-Internal Server Error.

(adding your lines to my htaccess will affect a server error...)

RewriteEngine On
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

AddDefaultCharset Off

any suggestions?
ruß Ole

Just replace the lines in the .htaccess with these:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

This should work.

@Dean:

This should not interfer with Etomite's built in rules, as this just rerouts the domain.com to www.domain.com.
If you accesing www.domain.com the rule does nothing ;)


[edit]
it seems you have found it already :D

Edited by Ed Headset, 20 October 2007 - 07:53 PM.


#6 Burkhard

    Etomite Forum Newbie

  • Member
  • 27 posts

Posted 24 October 2007 - 06:38 AM

Hallo Ole!

Bisher habe ich solche Weiterleitungen immer in der Serverkonfiguration eingestellt, dass der Nameserver
beide Aufrufe in das gleiche Verzeichnis weiterleitet.

Burkhard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users