CakePHP を使用します。ウェブサイトは www.villapalmeras.co.uk です。ルートを表示すると、リンクが正しく表示されます (つまり、http://www.villapalmeras.co.uk/public/events )。他のページに移動すると、同じリンクがhttp://www.villapalmeras.co.uk/websites/123reg/LinuxPackage25/jo/rd/an/jordanwallwork.co.uk/public_html/domains/villalaspalmeras/として表示されます公開/イベント
私は 123-reg ホスティング パッケージを使用しており、villapalmeras.co.uk ドメインをドメイン/villapalmeras という場所にマッピングしました (このルートは jordanwallwork.co.uk の私の Web サイトです)。.htaccesses ファイルを編集しようとしましたが、成功しませんでした。
私の .htaccess ファイルは次のとおりです。
/domains/villapalmeras/.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
/domains/villapalmeras/app/.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
/domains/villapalmeras/app/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
index.php:
define('APP_DIR', 'app');
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__FILE__));
define('WEBROOT_DIR', 'webroot');
define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
}
require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';