One of my favorite Apache modules is mod_rewrite. mod_rewrite allows me to manipulate page URLs so that I can search engine friendly URLs. Not every Apache server has the mod_rewrite module installed so you will want to add a conditional statement within your .htaccess file to make sure it's there.
我最喜欢的Apache模块之一是mod_rewrite。 mod_rewrite允许我操纵页面URL,以便可以搜索引擎友好的URL。 并非每个Apache服务器都安装了mod_rewrite模块,因此您将需要在.htaccess文件中添加条件语句以确保其存在。
.htaccess (The .htaccess)
#Wordpress's .htaccess code
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
If the "mod_rewrite.c" module is present, that means that mod_rewrite is available and will be used. If not, the mod_rewrite code will be ignored. Using this conditional statement will prevent 500 Internal Server Errors.
如果存在“ mod_rewrite.c”模块,则意味着mod_rewrite可用并将被使用。 如果不是,则mod_rewrite代码将被忽略。 使用此条件语句将防止500个内部服务器错误。