简体   繁体   English

我如何在没有 nginx.conf 或 .htaccess 的情况下在 PHP 中使用重写规则

[英]How i use Rewrite Rules in PHP without nginx.conf or .htaccess

I'm designing a website in PHP and I would like to work with rewrite rules.我正在用 PHP 设计一个网站,我想使用重写规则。 All the forums I look for say to edit nginx's configuration file or apache's htaccess file.我找的所有论坛都说要编辑 nginx 的配置文件或 apache 的 htaccess 文件。 How to use rewrite_rules in WordPress without editing anything on server?如何在 WordPress 中使用 rewrite_rules 而无需在服务器上编辑任何内容?

Can you please reply with a working sample..你能用一个工作样本回复吗..

Wordpress does use a rewrite file if the function is enabled and available to the server, basically what the rewrite does it redirect all requests to a main index.php file which then based on the URL format you have configured depends on how the URL is handled.如果该功能已启用并且可供服务器使用,Wordpress 确实会使用重写文件,基本上重写所做的是将所有请求重定向到主 index.php 文件,然后基于您配置的 URL 格式取决于 URL 的处理方式.

https://codex.wordpress.org/htaccess https://codex.wordpress.org/htaccess

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM