![]() Topic awaiting preservation: A common yet confusing .htaccess url redirection question... (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Northumberland, England |
![]() Ok, code: RewriteEngine on Would this work and is this the best way to do something like this? |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() aehm... the best way would be for your domains to just point to the different directories, |
Paranoid (IV) Inmate From: Northumberland, England |
![]() Would that be invisble or would the bobDir actually appear in the address bar (the idea is to avoid that all together) quote:
|
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() yeah, but you shouldn't be able to set documentRoot within .htaccess - only within the real server configuration. |
Paranoid (IV) Inmate From: Northumberland, England |
![]() Thanks buddy - one day I think I will buy a book on apache and htaccess since it is so useful yet I never get round to learning it properly. Online resources are good, but either not concise enough, or the ones that are concise are also too 'hi-brow' for a lowly designer/developer like myself. |
Paranoid (IV) Inmate From: Northumberland, England |
![]() ***Edit*** code: RewriteEngine On
|
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() Hm... try adding a [L] - signifing -last rule to apply to your rewriteRules and see if it still runs into the loop. |
Paranoid (IV) Inmate From: Northumberland, England |
![]() I have tried that, I've also tried escaping the . too |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() hm... give this a try code: RewriteEngine On |
Paranoid (IV) Inmate From: Madison, Indiana, USA |
![]() Try the following: code: RewriteEngine on |
Paranoid (IV) Inmate From: Northumberland, England |
![]() Hyperbole that seems to have worked great, |
Paranoid (IV) Inmate From: Madison, Indiana, USA |
![]() smonkey: The double dollar signs are misprints. Change them to read ^(.*)$. If what I gave you worked then Apache must be smart enough to realize you can only get to the end of a line once. code: RewriteCond %{HTTP_HOST} ^(ww+\.)?scrwd\.com tells Apache to look at the HTTP_HOST variable starting at the beginning look to see if it contains ww, www, wwww, etc followed by a dot. This is optional (the ? following the parentheses makes it optional. This means this line will accept scrwd.com, ww.scrwd.com, www.scrwd.com, wwww.scrwd.com, etc. |
Paranoid (IV) Inmate From: Northumberland, England |
![]() Cool, |