Note: This post was created awhile back on another platform and I migrated to my current one.
Problem:
Product’s images are not showing
One possible cause mentioned in the Ubercart forum is that Clean URLs is not enabled.
Step 1: Enable mod_rewrite
Clean URLs requires mod_rewrite
to be enabled
(Note:
mod_rewrite
is an Apache 2 module)
To check if mod_rewrite
is enabled, run the following command:
|
|
Look for:
|
|
This is the mod_rewrite
module required for Clean URLs.
Step 2: Enable mod_rewrite
if it’s not enabled
To enable mod_rewrite
, run:
|
|
After entering the command, you should see:
|
|
To disable mod_rewrite
, use:
|
|
After disabling, you should see:
|
|
Remember to restart Apache 2 after making changes:
|
|
Step 3: Check Your Apache 2 Configuration
(I’m an Apache 2 noob, so bear with me.)
In the /etc/apache2/sites-enabled
folder, create a config file for your Drupal site.
Example file: /etc/apache2/sites-enabled/drupal.conf
Basic Configuration:
|
|
Enable Rewrite Rules
Add the following inside the <Directory>
section:
|
|
Final Configuration:
|
|
Restart Apache 2 again:
|
|
Step 4: Enable Clean URLs in Drupal
-
Go to Administer → Site Configuration → Clean URLs
-
You should see the following path:
1
home > administer > site configuration
-
Enable Clean URLs.
Ta-da! 🎉 Now the product images should display correctly!
System Information:
Debian Lenny with Apache 2
For more information about mod_rewrite
:
Apache module mod_rewrite