我正在寻找正确的方法来处理redirect不安全(通过端口80)的请求,以确保(端口443)与Apache服务器configuration。 我不想把这个在我的.htaccess文件中。 目前我在我的httpd.conf文件中有这个: ServerName example.com ServerAlias *.example.com RewriteEngine On RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ RewriteRule ^(.*)$ https://%1.example.com/$1 [R=302,L] 目标是做一个通配符(在子域和子文件夹)redirect。 具体来说,这里有一些主要的用例: – http://subdomain.example.com到https://subdomain.example.com – http://example.com到https://www.example.com – http://www.example.com/contact/到https://www.example.com/contact – http://subdomain.example.com/contact/到https://subdomain.example.com/contact 简而言之,只要用https来replacehttp ,只要满足两个条件: 请求的URI包含mydomain.com 请求的URI不是安全的(仅限于httpstream量) 我已经尝试了许多不同的方法,但似乎没有捕获子域和子文件夹的所有变化,让我吃惊的是。 有任何想法吗? 谢谢!
我在Windows机器上使用了XAMPP,并且将这个代码添加到了httpd.conf文件中: <VirtualHost *:80> ServerName 23.23.23.23.23 Redirect 403 / ErrorDocument 403 "No" DocumentRoot C:/xampp/htdocs UseCanonicalName Off UserDir disabled </VirtualHost> 我尝试重新启动apache时出现此错误: 11:15:02 AM [Apache] Error: Apache shutdown unexpectedly. 11:15:02 AM [Apache] This may be due to a blocked port, missing dependencies, 11:15:02 AM [Apache] improper privileges, a crash, or a shutdown by another method. 11:15:02 AM [Apache] […]
我有一个Apache httpd代理(proxy.example.com),代理请求到应用程序服务器(app.example.com)。 现在我试图覆盖在请求到app.example.com与这样的指令的Host头: RequestHeader set Host proxy.example.com 但是,这只会将新的头部X-Forwarded-Host: proxy.example.com到请求中。 主机头本身在Host: app.example.com保持不变。 有没有人有一个想法,为什么这样的话? 我希望RequestHeader set Host <name>为覆盖Host头,如RequestHeader指令的文档中所述… 组 请求头被设置,用这个名字replace任何以前的头
我的sites-available有以下configuration文件sites-available <VirtualHost *:80> ServerName my.domain RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] </VirtualHost> <VirtualHost *:443> ServerName my.domain DocumentRoot /var/www/html ErrorLog /var/www/logs/error.log CustomLog /var/www/logs/access.log combined SSLEngine on SSLCertificateFile /var/www/certs/certificate.pem SSLCertificateKeyFile /var/www/certs/private.key SSLCertificateChainFile /var/www/certs/ca_bundle.pem <Directory /var/www/html> Options -Indexes AllowOverride All Require all granted </Directory> <Directory /var/www/html/nav> DirectoryIndex nav.exe AllowOverride All Require all granted </Directory> </VirtualHost> […]
我收到此错误消息。 我正在用Apache 2运行CentOS 5.2。我将如何重新创build这个文件? 有命令吗? 该服务器是从一个虚拟机映像构build的。 启动httpd:fopen:没有这样的文件或目录httpd:无法打开文件configuration文件/usr/local/apache/conf/httpd.conf / usr / local / apache / bin / apachectl startssl:httpd无法启动
我已经映射我的Apache到根/ var / www / vhosts。 如果我把文件/文件夹,我看到他们,可以冲浪他们。 但是,如果我把/ var / www / vhosts中的符号链接,我得到403 – 没有权限。 我有这个文件夹的指令: <Directory "/var/www/vhosts"> Options Indexes FollowSymLinks AllowOverride All </Directory>
我只是在Mac OS X 10.6.2 Snow Leopard中设置了Web共享。 我的httpd.conf允许ExecCGI,所有的文件夹和文件都是可读的,甚至可以被我写。 我在index.php中放入了一个简单的Hello World,但是我的apache错误日志显示了这个: [Thu Mar 18 00:17:18 2010] [error] [client 192.168.11.135] (13)Permission denied:exec of'/Users/abhic/Sites/index.php'failed [Thu Mar 18 00:17:18 2010] [错误] [客户端192.168.11.135] 脚本头过早结束:index.php <html> <head> <title> Hello </title> </head> <body> <?php echo "Hello"; ?> </body> </html> 是我的index.php看起来像放在/用户/ abhic /网站 我的浏览器显示500内部服务器错误 任何帮助都可以在半夜帮助我。 我一直试图解决这个太长时间。 谢谢。
我正在尝试使用configuration进行反向代理 <ifModule mod_proxy.c> ProxyRequests On <Proxy *> Order deny,allow # Deny from all Allow from all </Proxy> ProxyPass / http://localhost:8080/mysocial ProxyPassReverse / http://localhost:8080/mysocial ProxyVia On <IfModule mod_disk_cache.c> CacheEnable disk / CacheRoot "/var/cache/mod_proxy" </IfModule> </IfModule> 但是当我尝试访问http://domainname.com我在浏览器上出现以下错误… 该页面没有正确redirectFirefox已经检测到服务器正以一种永远不会完成的方式redirect这个地址的请求。 任何帮助,高度赞赏
我们想将我们的网站移到新的服务器上。 我创build了子域beta.domain.com,它指向我们新的服务器直接pipe理员。 在直接pipe理员,我已经设置了domain.com帐户,我希望该子域beta.domain.com指向与domain.com相同的目录。 我怎么能直接pipe理这个? 我在哪里可以写这样的规则? (我是新的直接pipe理员) NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> ServerName beta.domain.com DocumentRoot "/home/domain/public_html" </VirtualHost>
是否有可能设置VirtualHost ,但包括它从另一个文件重写? 使用.htaccess是不允许的。 像这样,我想… <VirtualHost 127.0.0.12> SetEnv APP_ENV dev … Include /path/to/vhostrewrite.conf </VirtualHost> 谢谢!