도메인이 두 개 있습니다. mydomain.com
및 mydomain.org
입니다. 사이트가 mydomain.org
에 있으므로 mydomain.com
을 시도하여 mydomain.org
으로 해결하려고합니다.mod_rewrite 조건 및 규칙 효과 POST vars가 잘못되었습니다.
학위를 준수하는 다음 mod_rewrite 규칙.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule^http://mydomain.org%{REQUEST_URI} [L,R=301]
나는 그것을 구현하고 테스트 한 후에 method = "post"를 사용하여 양식을 제출할 때까지 필요한 모든 작업을 수행하고 있다고 느꼈습니다. 어떤 이유
이 mod_rewrite를 내 _POST 내가 mydomain.org에서 유일하고 있어요을 바르 (나는에서 해결하기 위해 사이트를 원하는 TLD 인 내가에서 양식을 제출 한 경우) 삭제 한 사용자.
누구나 내 상태와 규칙을 조정하여 _POST 값을 잃지 않는 것을 알고 있습니까?
나는 흥미로운 것을 발견했다. Firefox에 HTTP 라이브 헤더 애드온을 연결했습니다. 내가 mod_rewrite를 사용할 때 "HTTP/1.1 404 Not Found"가 나타나고 mod_rewrite를 끄면 "HTTP/1.1 200 OK"가 표시됩니다. 동일한 페이지와 PHP 코드가 사용됩니다. 다시 말하지만 mod_rewrite 지시문을 끄면 _POST 데이터가 전달됩니다. mod_rewrite 지정 문을 켜면 _POST 데이터가 전달되지 않습니다.
mod_rewrite를 는 꺼진 :
http://dashausmuseum.org/subscribe.html
POST /subscribe.html HTTP/1.1
Host: dashausmuseum.org
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://dashausmuseum.org/subscribe.html
Cookie: __utma=74430599.461726749.1312575846.1312897084.1312899646.5; __utmz=74430599.1312575846.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=1.480711209.1312899756.1312979975.1312981669.5; __utmz=1.1312981669.5.5.utmcsr=dashausmuseum.com|utmccn=(referral)|utmcmd=referral|utmcct=/directions.html; __utmb=1.9.10.1312981669; PHPSESSID=7f4a74d7fde56cf901aa85511410b7f6; __utmc=1
Content-Type: application/x-www-form-urlencoded
Content-Length: 60
email=abc&firstName=&lastName=&address=&phone=&submit=Submit
HTTP/1.1 200 OK
Date: Wed, 10 Aug 2011 13:18:31 GMT
Server: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.3.4
X-Powered-By: PHP/5.3.4
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 5420
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
mod_rewrite를 이 켜진 :
http://dashausmuseum.org/subscribe.html
POST /subscribe.html HTTP/1.1
Host: dashausmuseum.org
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://dashausmuseum.org/subscribe.html
Cookie: __utma=74430599.461726749.1312575846.1312897084.1312899646.5; __utmz=74430599.1312575846.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=1.480711209.1312899756.1312979975.1312981669.5; __utmz=1.1312981669.5.5.utmcsr=dashausmuseum.com|utmccn=(referral)|utmcmd=referral|utmcct=/directions.html; __utmb=1.10.10.1312981669; PHPSESSID=7f4a74d7fde56cf901aa85511410b7f6; __utmc=1
Content-Type: application/x-www-form-urlencoded
Content-Length: 60
email=xyz&firstName=&lastName=&address=&phone=&submit=Submit
HTTP/1.1 404 Not Found
Date: Wed, 10 Aug 2011 13:20:32 GMT
Server: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.3.4
X-Powered-By: PHP/5.3.4
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 5329
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
사람이 무슨 일이 일어나고 있는지에 대한 단서를 제공하는 HTTP 헤더에 아무것도 볼 수 있습니까?
문법적으로 올바르지 않은 3 가지 지시어에 대해 아무도 볼 수 없습니까? –