0

私は 1 つの Web サーバーを持っています。このサーバーで 2 つの Web サイトを実行したいと考えています。SPIP を使用する 1 つの Web サイト (既に正常に動作しています) と Cakephp を使用する 1 つの Web サイト (問題あり)。

SPIP => /var/www/vitrine/

cakephp => /var/www/client/

Cakephp の Web サイトには からアクセスできますclient.<url>.euが、このアドレスにアクセスすると 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>

ありがとう :)

4

1 に答える 1

0

次の内容の .htaccess ファイルを /var/www/client に作成します。

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule    ^$    webroot/    [L]
RewriteRule    (.*) webroot/$1    [L]
</IfModule>

それは私のためにそのように動作します

于 2013-08-08T16:24:49.120 に答える