View previous topic :: View next topic |
Author |
Message |
pablo_supertux Advocate
Joined: 25 Jan 2004 Posts: 2931 Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)
|
Posted: Sun Oct 08, 2017 10:25 pm Post subject: Hilfe mit apache rewrite rules |
|
|
Hallo
ich will folgendes: Ich habe die domain www.example.com und thema1.example.com.
Ich will ein 301 Redirect von allen Seiten von www.example.com zu thema1.example.com außer http://www.example.com/ und http://www.example.com/index.html.
Mit
Code: |
<VirtualHost *:80>
ServerName www.example.com
...
RewriteRule (.*) http://thema1.example.com%{REQUEST_URI} [L,R=301]
</VirtualHost>
|
Das funktioniert gut, außer dass die URLs http://www.example.com/ und http://www.example.com/index.html ebenfalls mit 301 redirected werden. Die sollten aber jeweils index.html vom DocumentRoot lieferen.
Wie kann ich das machen in Apache? _________________ A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth! |
|
Back to top |
|
|
misterjack Veteran
Joined: 03 Oct 2004 Posts: 1655
|
Posted: Thu Oct 12, 2017 7:22 pm Post subject: Re: Hilfe mit apache rewrite rules |
|
|
RewriteCond ist dein Freund.
Code: |
RewriteCond %{REQUEST_URI} !^/index.html
RewriteCond %{REQUEST_URI} !^/$
RewriteRule (.*) http://thema1.example.com%{REQUEST_URI} [L,R=301]
|
_________________ „Meine Meinung steht fest! Bitte verwirren Sie mich nicht mit Tatsachen.“ |
|
Back to top |
|
|
|