Checking Apache mod rewrite
This manual explains how to verify that Apache’s mod_rewrite module is enabled and functioning correctly for your osCommerce 4.x installation.
1) Prepare a test file
Open the root directory of your website (or the admin directory if the pages under Sales Channels tab or the admin page do not load).
Create a file named check_mod_rewrite.php and add the following line:<?php echo "<h1>Mod_rewrite is working well</h1>";
2) Backup the existing .htaccess file
Rename the original .htaccess file to .htaccess_original.
3) Create a new .htaccess file
Create a new .htaccess file in the same directory and add:
RewriteEngine On
RewriteRule ^.*$ check_mod_rewrite.php
4) Test mod_rewrite functionality
Open your website (or the /admin page if that’s where the issue occurs).
- If you see the message “Mod_rewrite is working well”, then mod_rewrite is functioning correctly.
- If you see any other output, mod_rewrite is disabled or incorrectly configured.
5) Restore your original settings
Delete the temporary .htaccess file you created and rename .htaccess_original back to .htaccess.
By completing these steps, you can confirm whether Apache mod_rewrite is active and properly configured on your server.