我有一个 WordPress 站点,设置为 domian.com 现在我创建了一个名为 Scheduler 的文件夹并安装了 Laravel 应用程序。在我的 Laravel 应用程序中,我有一个 .htaccess,调度程序文件夹中包含以下内容
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* public/index.php [QSA,L]
</IfModule>
下面的 htaccess 是 WordPress 站点所在的主服务器文件夹
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我需要发生的是domian.com/scheduler或domain.com/scheduler/.....应该指向调度程序目录并运行laravel应用程序我做错了什么我需要添加到主目录中htaccess
添加另一个带有最后一个
L
标志的重写规则:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^scheduler($|/) - [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
在 cpanel 或您的托管提供商中,转到域,然后单击创建新域,在域字段中单击此后写入您的子域,在文档根字段中写入公共 html/scheduler ,现在您可以使用此子域访问我们的路线。