Portál AbcLinuxu, 7. května 2025 20:10
Potreboval bych toto,cokoliv.site.com ---> www.site.com
RewriteEngine on
RedirectMatch ^/(.*)$ http://www.site.com/$1 [R]
ale spravne dostanu "GET 302 text/html (NS_ERROR_REDIRECT_LOOP) http://www.site.com/"
Potreboval bych novou hodnotu RedirectMatch nebo navic RedirectCond
Řešení dotazu:
RewriteCond %{HTTP_HOST} ^site\.com RewriteCond %{HTTP_HOST} ^.*\.site\.com RewriteRule ^(.*)$ http://www.site.com/$1 [R=permanent,L]
RewriteCond %{HTTP_HOST} ^site\.com [OR] RewriteCond %{HTTP_HOST} ^.*\.site\.com RewriteRule ^(.*)$ http://www.site.com/$1 [R=permanent,L]
ServerAlias *.mujserver.cz mujserver.cz RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.mujserver\.cz [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) http://www.mujserver.cz/$1 [L,R]A bezi :)
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.