Apache - 虚拟主机没有进入正确的目录?

时间:2017-09-11 04:46:07

标签: apache centos virtualhost httpd.conf

当我httpd -S时,我可以看到语法确定

port 443 namevhost xyz.example.com 
         alias xyz.example.com 

但是当我访问https://xyz.example.com/ajax/query时 它转到错误的目录而不是定义的目录。

修改

<VirtualHost *:443>

  SSLEngine on
  SSLProtocol all -SSLv2
  SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
  SSLCertificateFile /root/digicert/LIVE/xyz.crt
  SSLCertificateKeyFile /root/digicert/LIVE/xyz.key
  SSLCertificateChainFile /root/digicert/LIVE/xyz.ca

  DocumentRoot "/home/www/html/xyz/public"
  ServerName xyz.example.com
  ServerAlias xyz.example.com
   <Directory /home/www/html/xyz/public>
      #AddDefaultCharset utf-8
      DirectoryIndex index.php
      #AllowOverride FileInfo
      AllowOverride All
      Order allow,deny
      Allow from all
   </Directory>
  ErrorLog logs/ssl_error_log
  TransferLog logs/ssl_access_log
  LogLevel warn


  <Files ~ "\.(cgi|shtml|phtml|php3?)$">
      SSLOptions +StdEnvVars
  </Files>
  <Directory "/var/www/cgi-bin">
      SSLOptions +StdEnvVars
  </Directory>

  SetEnvIf User-Agent ".*MSIE.*" \
           nokeepalive ssl-unclean-shutdown \
           downgrade-1.0 force-response-1.0
  CustomLog logs/ssl_request_log \
            "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

# cat .htaccess 

RewriteEngine On


<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

0 个答案:

没有答案