Wordpress/Lumberjack-尝试访问路线时显示404页
我正在开始使用和,并且我正在尝试简单地让一个“Hello World”示例工作。到目前为止没有成功。我添加了几个路由并创建了一个控制器,但每当我访问example.com/Test或/hello world时,我都会收到一个404错误 有人能帮我解决这个问题吗 在我的Wordpress主题Wordpress/Lumberjack-尝试访问路线时显示404页,wordpress,Wordpress,我正在开始使用和,并且我正在尝试简单地让一个“Hello World”示例工作。到目前为止没有成功。我添加了几个路由并创建了一个控制器,但每当我访问example.com/Test或/hello world时,我都会收到一个404错误 有人能帮我解决这个问题吗 在我的Wordpress主题routes.php文件中,我有: <?php use Rareloop\Lumberjack\Facades\Router; use Zend\Diactoros\Response\HtmlRespo
routes.php
文件中,我有:
<?php
use Rareloop\Lumberjack\Facades\Router;
use Zend\Diactoros\Response\HtmlResponse;
Router::get('Test', function () {});
Router::get('hello-world', function () {
return new HtmlResponse('<h1>Hello World!</h1>');
});
我也遇到了同样的问题,我通过在我的项目文件夹的根目录中包含一个.htaccess
来解决它,其中包含以下内容:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]