Lumen 5.6 htaccess问题

时间:2018-02-22 09:26:57

标签: .htaccess lumen

WordPress已安装在生产服务器的根目录上,我的Lumen框架位于public_html / developer / api文件夹中,但当我们尝试通过url访问api文件夹时,它显示WordPress 404页面未找到错误。一个htaccess文件放在api(Lumen)文件夹中,另一个放在/ developer / api / public中。

api文件夹中的htaccess文件代码:

RewriteEngine On

RewriteBase /developer/api/

# Redirect Trailing Slashes...

RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond $1 !^(index\.php|images|quotes|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /developer/api/public/index.php/$1 [L,QSA]

和api / public:

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

    RewriteEngine On

    # 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]
</IfModule>

0 个答案:

没有答案