将站点移至另一个域

Remove site to another domain

我尝试将网站移至另一个域。新域站点位于子文件夹中,我对 htacces

有疑问

htacces 在我的旧域上 mydomain.com

RewriteEngine on
RewriteCond  !^(index\.php|public|media|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L,QSA]

新站点位置是 mydomain。com/site/

页面和图片的链接不好。

如果它在子文件夹中,您需要添加 rewritebase。确保此 .htaccess 也在 /site/.htaccess

RewriteEngine on
RewriteBase /site/
RewriteCond  !^(index\.php|public|media|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L,QSA]