简体   繁体   English

wordpress.htaccess的意义是什么?

[英]What is the significance of .htaccess of wordpress?

Here is .htaccess from my local wordpress installation. 这是我本地wordpress安装中的.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

# END WordPress

Even when I have removed these directives from the .htaccess file still wordpress works fine, why is that so? 即使我从.htaccess文件中删除了这些指令, wordpress正常工作,为什么会这样呢? why was this added if wordpress can work fine without it? 如果没有wordpress可以正常工作,为什么还要添加呢?

This is utilizing Apache's mod_rewrite so your Wordpress installation can make use of nice-looking URLs that look something like http://www.example.com/2015/8/12/my-post-title/ instead of http://www.example.com/?post=173663 . 这是利用Apache的mod_rewrite因此您的Wordpress安装可以使用外观精美的URL,这些URL看起来像http://www.example.com/2015/8/12/my-post-title/而不是http://www.example.com/?post=173663 This improves your SEO and users' experiences on your site, and the vast majority of major blogging software supports it! 这可以改善您在网站上的SEO和用户体验,绝大多数主要的博客软件都支持它!

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

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