我有一台网络服务器。我想在这台服务器上运行2个网站。 1个SPIP网站(已经运行良好)和1个带有cakephp的网站(问题)。
SPIP =>的/ var / WWW /玻璃柜/
cakephp =>的/ var / WWW /客户端/
可以通过client.<url>.eu
访问cakephp网站,但是当我去这个地址时,我有404错误。你能说我为什么吗?
这是我的/ etc / apache2 / sites-available / default:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/vitrine
ServerName <url>.eu
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/vitrine>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/client/app/webroot
ServerName client.<url>.eu
<Directory /var/www/client>
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
这里是/var/www/client/app/.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
这里是/var/www/client/app/webroot/.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
谢谢:)
答案 0 :(得分:0)
在/ var / www / client创建一个.htaccess文件,其中包含以下内容:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
这对我有用