2013-09-06 1 views
0

에 각 페이지는 도메인으로 리디렉션 왜? 나는 dkcherta.ru 이동 -> dkchertanovo.ru을하고 싶어 예를 들어 http://dkcherta.ru/index.php?id=80 ->http://dkchertanovo.ru/index.php?id=80htaccess로 리디렉션의 index.php? Q = *가되는 index.php? Q를 = * 다른 도메인

내 htaccess로 :

Options +FollowSymLinks -MultiViews 
RewriteEngine On 

:

Options +FollowSymlinks -MultiViews 
RewriteEngine On 

RewriteCond %{HTTP_HOST} ^(www\.)?dkcherta\.ru$ [NC] 
RewriteRule^http://dkchertanovo.ru/%{REQUEST_URI} [L,R=301] 

RewriteRule ^rss_afisha[/]?$ /index.php?id=230 [L] 
RewriteRule ^rss_news[/]?$ /index.php?id=231 [L] 

ErrorDocument 404 http://dkchertanovo.ru/ 
# For full documentation and other suggested options, please see 
# http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions 
# including for unexpected logouts in multi-server/cloud environments 

RewriteBase/    

# Сливка доменного имени 
#RewriteCond %{HTTP_HOST} ^dkchertanovo\.ru$ [NC] 
#RewriteRule ^(.*)$ http://www.dkchertanovo.ru/$1 [R=301,L] 

RemoveHandler .php .htm .html 
AddType application/x-httpd-php .php .htm .html 
AddHandler application/x-httpd-php .php .htm .html 
php_flag register_globals off 

# Fix Apache internal dummy connections from breaking [(site_url)] cache 
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC] 
RewriteRule .* - [F,L] 

# Exclude /assets and /manager directories from rewrite rules 
RewriteRule ^(manager|assets) - [L] 

# For Friendly URLs 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] 


### force www 
    #RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] 
    #RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 
    #RewriteBase/


# Reduce server overhead by enabling output compression if supported. 
#php_flag zlib.output_compression On 
#php_value zlib.output_compression_level 5 
+0

는 요청이 해석되는 방법 확인하기 위해 재 작성 엔진에서 디버깅을 켜기 시도? – Floris

답변

2

당신이 여러 줄 필요가 없습니다 상단에 한 번만 넣으면 파일의 나머지 부분에 효과적이어야합니다.

그런 다음에 문제가 .htaccess 파일의 모든 다른 규칙의 상단에이 규칙을 이동 해결하기 위해 :

RewriteCond %{HTTP_HOST} ^(www\.)?dkcherta\.ru$ [NC] 
RewriteRule^http://dkchertanovo.ru%{REQUEST_URI} [L,R=301] 
+0

anubhava 아니,이 규칙을 이동 (RewriteRule의 (^. *) http://dkchertanovo.ru/$1 [L, R = 301]) 상단이 문제가 해결되지 않는 ...에 – almix

+0

다른을 사용하세요 브라우저에서 테스트합니다. 이 URL을 테스트하기 위해 입력 한 URL은 무엇입니까? 또한 정확히 어떤 디렉토리에이'.htaccess'가 놓여 있습니까? – anubhava

+0

.htaccess가 루트에 있습니다. try ur - http://dkcherta.ru/index.php?id=301 - 홈 페이지 dkchertanovo.ru로 리디렉션합니다. 리디렉션도 사용하고 있습니다. 사용하지 않도록 설정할 수 있습니까? – almix