我正在尝试将我的门户与我的网站集成。
我的网站 :
http://example.com
和我的门户:
http://portal.com
现在我想从以下位置查看我的门户:
http://example.com/portal
我的核心 apache 配置文件的一部分(启用站点/网站):
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.com
DocumentRoot /home/example/WebSite2.0/WebContent
DirectoryIndex index.php index.html
<Directory /home/example/WebSite2.0/WebContent>
Options +IncludesNOEXEC
AllowOverride None
Order allow,deny
allow from all
XBitHack On
AddType text/html .html
AddHandler server-parsed .html
</Directory>
Alias /portal /home/example/portal/CodeIgniter_2.1.0
<Directory /home/example/portal/CodeIgniter_2.1.0>
DirectoryIndex "index.php"
allow from all
Options +Indexes
#Options FollowSymLinks MultiViews
Order allow,deny
RewriteEngine On
RewriteBase /portal
#RewriteRule ^test\.html$ test.php
RewriteCond $1 !^(index\.php|css|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteCond $1 ^(css|images|js)
RewriteRule ^(.*)$ $1
</Directory>
</VirtualHost>
正如您在 CodeIgniter 之上看到的我的门户功能;因此 -
RewriteCond $1 !^(index\.php|css|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
我的核心 apache 配置文件的一部分(启用站点/门户):
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName portal.com
ServerAlias www.portal.com
DocumentRoot /home/example/portal/CodeIgniter_2.1.0
DirectoryIndex "index.php"
SSLEngine On
SSLCertificateFile "ssl/portal.com.crt"
SSLCertificateKeyFile "ssl/portal.com.key"
<Directory /home/example/portal/CodeIgniter_2.1.0>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Header unset Server
ServerSignature Off
</Directory>
</VirtualHost>
现在真正的问题是,当我打开http://example.com/portal时,浏览器会DocumentRoot
在Alias
.
例如来自门户的图像,
<img src="/images/example.png" style="margin-left:30px;height:50px;">
apache错误日志说 -
File does not exist: /home/example/WebSite2.0/WebContent/images/example.png
我不想更改我的代码。我只想让这个东西从 apache 配置文件本身工作。请帮我做这件事。