Search Engine: Elastic

Article ID: 129296, created on Aug 22, 2016, last review on Aug 22, 2016

  • Applies to:
  • Operations Automation


How to check if mod_rewrite is enabled on customer's website?


  1. Check the following module on the corresponding Web Server in the list of Apache modules:

    # httpd -M | grep rewrite
    Syntax OK
    rewrite_module (shared)
  2. Check that this module is enabled via phpinfo page for this domain. Create phpinfo.php file with the following content in the root directory of the webste:


    Access and make sure that MOD_REWRITE module is shown as 'enabled'.

  3. Modify .htaccess file to enable mod_rewrite for a single website:

    <IfModule mod_rewrite.c>
    #check if mod rewrite is enabled
    SetEnv MOD_REWRITE enabled
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    The above .htaccess file (if placed in the DocumentRoot) will redirect all traffic to the index.php file of the website root directory.

  4. Create the following files to test mod_rewrite module:

    # cat /var/www/vhosts/
    RewriteEngine On
    RewriteRule ^.*$ mod_rewrite.php
    # cat /var/www/vhosts/
    <?php echo "Mod_rewrite is activated!"; ?>

    and access the url

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF