博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
.htaccess文件_WordPress的.htaccess文件是天才
阅读量:2514 次
发布时间:2019-05-11

本文共 1788 字,大约阅读时间需要 5 分钟。

.htaccess文件

Choosing to use WordPress was a more difficult decision that you may think. Sure, WordPress is the most used blogging software on the internet, but I'm a programmer, right? I should want to code everything myself, right? I thought that at first but I decided to try WordPress first and I've been impressed with every part of WordPress so far. One of the interesting parts of WordPress is the URL rewriting and "slug" that gets created for each post. How did they do that?

您可能会认为,选择使用WordPress是一个比较困难的决定。 当然,WordPress是互联网上最常用的博客软件,但是我是程序员,对吗? 我应该自己编写所有代码,对吗? 最初我以为是这样,但我决定先尝试WordPress,到目前为止,WordPress的每个部分都给我留下了深刻的印象。 WordPress有趣的部分之一是为每个帖子创建的URL重写和“ slug”。 他们是怎么做到的?

Well, I know enough about SEF (search engine friendly) links to know that an .htaccess file had to be involved so I downloaded the .htaccess file from my hosting server and saw:

好吧,我对SEF (搜索引擎友好)链接了解得足够多,知道必须包含.htaccess文件,因此我从托管服务器下载了.htaccess文件,并看到:

RewriteEngine OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]

That's it? Yep. Basically, the flow goes as follows:

而已? 是的 基本上,流程如下:

  1. We must first establish that mod_rewrite is available on the server

    我们必须首先确定mod_rewrite在服务器上可用
  2. If so, turn on mod_rewrite

    如果是这样,请打开mod_rewrite
  3. Set the base of all rewriting to the web root folder

    将所有重写的基础设置到Web根文件夹
  4. If the requested filename isn't a file....

    如果请求的文件名不是文件...。
  5. ....and it isn't a folder...

    ....这不是文件夹...
  6. Send the person to index.php

    将该人发送到index.php

Once inside the index.php file, the index.php file processes the request and presents you with the page based upon the slug in the URL. Very simple .htaccess code runs a reliable WordPress blog.

进入index.php文件后, index.php文件将处理请求,并根据URL中的链接向您显示页面。 非常简单的.htaccess代码可运行可靠的WordPress博客。

翻译自:

.htaccess文件

转载地址:http://wdpwd.baihongyu.com/

你可能感兴趣的文章
一致性Hash算法及使用场景
查看>>
JS - Lexical Structure
查看>>
【2】oracle创建表空间
查看>>
剑指offer-二叉树中和为某一值的路径
查看>>
Java反射机制
查看>>
Python 正则表达式
查看>>
C++ AppendMenu
查看>>
在所选中的物体中取消选中一些物体.txt
查看>>
grid - 网格项目跨行或跨列
查看>>
Shell 基本运算符
查看>>
2019年2月
查看>>
Google Noto Sans CJK 字体
查看>>
ES集群性能调优链接汇总
查看>>
STL库的应用
查看>>
spark算子
查看>>
(转)Linux服务器SNMP常用OID
查看>>
zoj2112 主席树动态第k大 ( 参考资料链接)
查看>>
弹出框popupWindow
查看>>
Python学习(007)-函数的特性
查看>>
扑克牌的顺子
查看>>