简体   繁体   English

在此服务器上找不到请求的 URL。 - php,wordpress

[英]The requested URL was not found on this server. - php, wordpress

I have the following folder structure on my local -我在本地有以下文件夹结构 -

xampp\htdocs\wordpress\wp-content\themes\mdbblog

on my local and under this directory, have following files -在我的本地和这个目录下,有以下文件 -

在此处输入图片说明

I activated mdblog theme from http://localhost/wordpress/wp-admin/ and able to access the index page of my site http://localhost/wordpress .我从http://localhost/wordpress/wp-admin/激活了mdblog主题,并且能够访问我的站点http://localhost/wordpress的索引页面。

The problem is I am unable to href any other page from home page.Following is my code to access Gallery in the menu -问题是我无法从主页href任何其他页面。以下是我在菜单中访问图库的代码 -

<li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown"
              aria-haspopup="true" aria-expanded="false">Gallery</a>
            <div class="dropdown-menu dropdown-primary" aria-labelledby="navbarDropdownMenuLink">
              <a class="nav-link" style="padding:5px 10px;" href="./clinic-gallery-page.php">Clinic </a>
              <a class="nav-link" style="padding:5px 10px;" href="patients-gallery-page.php">Patients</a>
            </div>
        </li>

When I click Clinic , I get following error -当我单击Clinic ,出现以下错误 - 在此处输入图片说明

I have no clue as what am I doing wrong here.我不知道我在这里做错了什么。 I new to PHP and Wordpress.我刚接触 PHP 和 Wordpress。 I also don't see any pages present under mdblog theme on admin.我也没有在管理员的mdblog主题下看到任何页面。 Is that expected?这是预期的吗? Any help is much appreciated.任何帮助深表感谢。

Ok, sooo WordPress isn't exactly a file request type system.... WordPress will only resolve based on your db... Read te docs or ask more direct questions.好吧,所以 WordPress 不完全是一个文件请求类型系统.... WordPress 只会根据您的数据库进行解析...阅读 te 文档或提出更直接的问题。 I advise you:我劝你:

  1. Create a page.创建一个页面。 .. this pages will register a route (sortoff) on your db .. 这个页面会在你的数据库上注册一个路由(sortoff)
  2. Assign that page to your menu将该页面分配给您的菜单

Big warning.大警告。 When you create a localhost page on development, this will be written like that on your db.当你在开发中创建一个 localhost 页面时,这将在你的数据库上写成这样。 When you take this to a production server, you will end up with some links as localhost and some as the domain.当你把它带到生产服务器时,你最终会得到一些作为 localhost 的链接和一些作为域的链接。 U will either always have to redirect, or before you upload your db to production, you can dump the sql, and do a find localhost and replace with your new domain on notepad ++你要么总是必须重定向,或者在你将数据库上传到生产之前,你可以转储 sql,并在记事本++上查找本地主机并替换为你的新域

Unless you are creating your own theme.除非您正在创建自己的主题。 I wouldn't add files directly to your theme as it can be overwritten on an update.我不会将文件直接添加到您的主题中,因为它可能会在更新时被覆盖。 Create a plugin.创建一个插件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在此服务器上找不到请求的URL。 在PHP codeigniter上 - The requested URL was not found on this server. on php codeigniter “在此服务器上找不到请求的URL / projectname / pagename /。”WordPress网站上的问题 - “The requested URL /projectname/pagename/ was not found on this server.” issue on WordPress website 在此服务器上找不到请求的URL /index.php。 - The requested URL /index.php was not found on this server.? 在此服务器上找不到请求的URL。 Magento与oAuth - The requested URL was not found on this server. Magento with oAuth Apache:在此服务器上找不到请求的 URL /。 阿帕奇 - Apache: The requested URL / was not found on this server. Apache 在此服务器上找不到请求的URL。 阿帕奇 - The requested URL was not found on this server. Apache 找不到对象! 在此服务器上找不到请求的URL。 无法访问PHP文件 - Object not found! The requested URL was not found on this server. PHP file not being accessed 未找到 在此服务器上未找到请求的 URL。 xampp 错误 - Not Found The requested URL was not found on this server. xampp error 找不到在此服务器上找不到请求的URL / emr / login。 在Laravel - Not Found The requested URL /emr/login was not found on this server. in Laravel 未找到对象! 在此服务器上找不到请求的 URL。 本地主机 - Object not found! The requested URL was not found on this server. localhost
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM