Toon posts:

[apache] AliasMatch all urls naar dezelfde directory (regex)

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik wil met AliasMatch ervoor zorgen dat alle urls van een domein naar dezelfde directory verwijzen. Als voorbeeld:

http://www.domein.com/dir/test.html moet het bestand http://www.domein.com/test.html opvragen. Maar http://www.domein.com/dir/dir/test.html moet ook het bestand http://www.domein.com/test.html opvragen. En http://www.domein.com/dir/dir/dir/test.html moet ook het bestand http://www.domein.com/test.html opvragen.

Uiteindelijk zal het dus zoiets moeten worden:
code:
1
AliasMatch ^/([^/]*)/?(.*) /home/domein.com/public_html/$2

Het probleem is hier alleen mee dat het dus werkt voor http://www.domein.com/dir/test.html, maar niet voor http://www.domein.com/dir/dir/test.html. Ik begrijp niet hoe ik alle directories kan specificeren met behulp van regular expressions.

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 15-04 22:07

NMe

Quia Ego Sic Dico.

code:
1
AliasMatch ^/([^/]*/)*(.*) /home/domein.com/public_html/$2

Zo?

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


Verwijderd

Topicstarter
Ja dat werkt dus wel, in tegenstelling tot de 101 andere opties die ik heb geprobeerd |:( . Bedankt!

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 15-04 22:07

NMe

Quia Ego Sic Dico.

Begrijp je ook waarom deze wel werkt en die van jou niet? :)

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.