• Sosabowski
  • Registratie: Juni 2003
  • Laatst online: 18-12-2025
Ik heb een site met een subdomijn. Op de server zit het subdomein in een subfolder.
http://domein.com = /home/user/public_html
http://sub.domein.com = /home/user/public_html/sub
http://domein.com/sub = /home/user/public_html/sub

Dus alles wat in sub staat is te bereiken via zowel sub.domein.com als domein.com/sub. Graag wil ik request die vragen naar domein.com/sub/* verwijzen naar sub.domein.com/*

Ik ben tot hier gekomen:
code:
1
2
RewriteCond %{REQUEST_URI} ^/sub/(.*)$
RewriteRule ^(.*)$  http://sub.domein.com/%1 [L,R=301]

Als de url begint met "sub" dan naar rewriterule. "(.*)$" Alles herschrijven naar http://sub.domein.com/%1
Waar %1 verwijst naar de (.*) in rewritecond.

Maar het werkt niet. Wie ziet de fout?

The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts. -- Bertrand Russell