Checking Apache mod rewrite: Difference between revisions
Jump to navigation
Jump to search
1. Open the root directory (or admin directory if you fail to open the admin page) of your website, create a file check_mod_rewrite.php with the following line:
3. Create a new .htaccess file with the following line:
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 8: | Line 8: | ||
<h4>1. Open the root directory (or admin directory if you fail to open the admin page) of your website, create a file '''check_mod_rewrite.php''' with the following line: | <h4>1. Open the root directory (or admin directory if you fail to open the admin page) of your website, create a file '''check_mod_rewrite.php''' with the following line: | ||
<code><?php echo "<nowiki><h1>Mod_rewrite is working well</h1></nowiki>";</code> | <code><?php echo "<nowiki><h1>Mod_rewrite is working well</h1></nowiki>";</code></h4> | ||
2. Rename the original file from .htacess to '''.htacess_original''' | <h4>2. Rename the original file from .htacess to '''.htacess_original'''</h4> | ||
3. Create a new .htaccess file with the following line: | <h4>3. Create a new .htaccess file with the following line: | ||
<code>RewriteEngine On</code> | <code>RewriteEngine On</code> | ||
<code>RewriteRule ^.*$ check_mod_rewrite.php</code> | <code>RewriteRule ^.*$ check_mod_rewrite.php</code></h4> | ||
4. Open your web site (or /admin page). If you see a message “Mod_rewrite is working well”, it is ok. If you see anything else - mod_rewrite is disabled or incorrectly configured. | <h4>4. Open your web site (or /admin page). If you see a message “Mod_rewrite is working well”, it is ok. If you see anything else - mod_rewrite is disabled or incorrectly configured.</h4> | ||
5. Delete the .htaccess file you created and rename the original file back.</h4> | <h4>5. Delete the .htaccess file you created and rename the original file back.</h4> |