apache tutorial - Rewrite Engine - apache - apache web server - apache server - apache2

Rewrite Engine in Apache

The RewriteEngine module within Apache is used to dynamically rewrite URLs and paths depending on various expressions provided:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [END]
click below button to copy the code. By Apache tutorial team

The above rules will rewrite PHP files to no longer show their extension, and so that index.php will just show as a naked domain (similar to the behavior normally seen in index.html). The above rule ships with WordPress.

Note that in Apache httpd 2.2.16 and later, this entire block can be replaced with a single line using the FallbackResource directive:

FallbackResource /index.php
click below button to copy the code. By Apache tutorial team

Related Searches to Rewrite Engine in Apache

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.