mrad,
Hmmm, IMHO, better to have continued that thread. No problem.
Never post or link to phpinfo(); as the output gives too much information (saving a hacker a lot of time and effort).
[EDIT: I performed your test, in fact htaccess is not enabled, the original html file displays, so I hope support will enable htaccess]
Well, that scotches your code! Of course, the following SHOULD generate site-wide 500 errors (for what should be considered syntax errors for unrecognized commands).
RewriteEngine on
RewriteCond %{HTTP_HOST} www\\.mradlmaier\\.blaced\\.net$ [NC] OR
RewriteCond %{HTTP_HOST} mradlmaier\\.blaced\\.net$ [NC]
RewriteRule .? http://www.mradlmaier.com%{REQUEST_URI} [R=301,L]
Well, I thought you were redirecting everything at blaced.net? Why not just test %{HTTP_HOST} against blaced\.net$ [NC]?
I am not sure if I can have to conditions tested with an OR, though?
I’m not sure what you’re asking. Use of [AND] is assumed so, if you’re trying to match A OR B (as you were above), then the [OR] flag is required. Note that the default AND cannot match both www.anything$ and anything$.
Horray!
However I think the abov code is somewhat wrong, I think it should be:
Why not (as above):
RewriteEngine on
[COLOR="#A9A9A9"]RewriteCond %{HTTP_HOST} ^www\\.mradlmaier\\.blaced\\.net$ [NC] OR [/COLOR]
RewriteCond %{HTTP_HOST} [COLOR="#A9A9A9"]^mradlmaier[/COLOR]\\.blaced\\.net$ [NC]
RewriteRule .? http://www.mradlmaier.com%{REQUEST_URI} [R=301,L]
Changing the domain, the code should be the same:
RewriteEngine on
[COLOR="#A9A9A9"]RewriteCond %{HTTP_HOST} ^www\\.mradlmaier\\.bplaced\\.net$ [NC] OR [/COLOR]
RewriteCond %{HTTP_HOST} [COLOR="#A9A9A9"]^mradlmaier[/COLOR]\\.bplaced\\.net$ [NC]
RewriteRule .? http://www.mradlmaier.com%{REQUEST_URI} [R=301,L]
IF both domains are co-located, then just \.net$ would do the same thing!
But this doesnt work. While I am getting the right files displayed, the address bar never changes. I was thinking a 301 Redirect will cause the new URL displaying in the browser bar?
Correct! The R=301 will force the browser to display the redirection (as will the http://www.mradlmaier.com in the redirection).
Having the new URL displayed in the browser address bar is the goal. If it doesn’t change, I dont konw for what I need the whole .htaccess thingie?
Aw, that’s not always the case, ergo, the option to use http:// and the R=301 flag. It depends upon your needs. Have another look at the coding samples for ideas.
My problem is NOT that, I dont get the right files displayed, but that I dont get the right URL displayed in the browser’s address bar.
Or is this a misconception?
As above, that’s NOT a misconception with the correct code (which you showed).
Regards,
DK