首页 > 解决方案 > 迁移和更改目录后缺少 PHP 脚本图像

问题描述

迁移到另一个域后,我已将我的 PHP 脚本安装在我的网站 psc.af/photo 的目录中,并在其主目录(cPanel 中的 public_html)中一切正常,但图像未显示。当我检查图像链接时,它显示 mynewdomain.com/photo/images 不是,它从我以前安装的子目录中获取了照片目录。所以我看不到图像。我试图更改我的应用程序 url 并且它很好,唯一的问题是缺少图像。

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:cDd2jFWmOeQajBVf+UbCcCW9v0OxeZC/w+mp8qwgw0g=
APP_DEBUG=true
APP_URL=http://psc.af/

这是我的 .htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    Options -Indexes

    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>

    <Files composer.json>
    order allow,deny
    deny from all
    </Files>

    <Files composer.lock>
        order allow,deny
        deny from all
        </Files>

    <Files .env>
    order allow,deny
    deny from all
    </Files>

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Remove index.php
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

</IfModule>

标签: phpdirectorymigration

解决方案


推荐阅读