|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I tried this also in the virtual host section but I do not want to make
it more difficult so I moved it into the .htaccess file. Problem: I have two domains www.mark-fink.de and www.mark-fink.com. Now I want to enforce the use of www.mark-fink.de all others (mark-fink.com ...) should be directed to this url. I set the aliases in the virtual host I use section (file since I use debian sarge). the .htaccess file looks like this: # Force usage of www.mark-fink.de RewriteCond %{HTTP_HOST} !^www\.mark-fink\.de [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) http://www.mark-fink.de/$1 [L,R] # enable url rewriting for Typo3 RealURL extension RewriteEngine On RewriteRule ^typo3$ - [L] RewriteRule ^typo3/.*$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule .* index.php (the typo3 realurl works fine) I configured the cannonical hostname section according to the apache manual for version 1. Is something discontinued or altered? Any ideas? Regards, Mark |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Wed, 09 Mar 2005 19:49:27 +0100,
Mark <mark_fink@web.de> posted: > I tried this also in the virtual host section but I do not want to make > it more difficult so I moved it into the .htaccess file. So long as you're aware that some things can't be done in .htaccess files, though this doesn't seem to be one of them. > Problem: > I have two domains www.mark-fink.de and www.mark-fink.com. Now I want to > enforce the use of www.mark-fink.de all others (mark-fink.com ...) > should be directed to this url. I set the aliases in the virtual host I > use section (file since I use debian sarge). > > the .htaccess file looks like this: > # Force usage of www.mark-fink.de > RewriteCond %{HTTP_HOST} !^www\.mark-fink\.de [NC] > RewriteCond %{HTTP_HOST} !^$ > RewriteRule ^/(.*) http://www.mark-fink.de/$1 [L,R] The example I followed looked like this, and that sort of thing does work for me: RewriteCond %{HTTP_HOST} ^mark-fink.de$ [NC] RewriteRule ^(.*)$ http://www.mark-fink.de/$1 [R=301,L] I haven't tried it with the !^www\, not variation, but you can. Note the "R=301", that makes the redirect a permanent redirect, rather than a temporary one. i.e. All future references should use the new URI, and bookmarks and databases using the old ones should be updated. Without that, things like search engines will continue to use the URI that you don't want them to. Should your RewriteEngine on directive be nearer the top of the .htaccess file? -- If you insist on e-mailing me, use the reply-to address (it's real but temporary). But please reply to the group, like you're supposed to. This message was sent without a virus, please delete some files yourself. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Hi Tim!
Works now. Absolutely great support. Many thanks. Cheers, Mark |
|
![]() |
| Outils de la discussion | |
|
|