2012-06-22 50 views

回答

1

您可以通过调整你的Apache配置是这样做的:

# Turn on Rewriting 
RewriteEngine on 

# Apply this rule If request does not arrive on port 443 
RewriteCond %{SERVER_PORT} !443 

# RegEx to capture request, URL to send it to (tacking on the captured text, stored in $1), Redirect it, and Oh, I'm the last rule. 
RewriteRule ^(.*)$ https://www.x.com/dir/$1 [R,L] 

请注意,这是从https://serverfault.com/questions/77831/how-to-force-ssl-https-on-apache-location拍摄。

django不应该有任何必要的更改。 HTH。

+0

谢谢!这将有所帮助。一旦我尝试,将答案标为正确。 – Babu

相关问题