1

I am running XAMPP 1.8.3 + bitnami installation of Magento 1.8.0.0 on Windows 7. I would like to get rid of index.php in the URLs I see. Here is the rest of my setup:

1) I have entered a dummy host name for my local testing environment in C:\Windows\System32\drivers\etc\hosts so that it contains the following line and restarted Apache:

127.0.0.1   localhost   myhost.com

2) I have secured my XAMPP installation by following the setup found at http://myhost.com/security/index.php

3) I have had a look at C:\xampp\apache\conf\httpd.conf and the line that loads the Apache Rewrite module is already uncommented and the htdocs directory under C:\xampp already has .htaccess files enabled as follows (comments deleted):

LoadModule rewrite_module modules/mod_rewrite.so

<Directory "C:/xampp/htdocs">
  Options Indexes FollowSymLinks Includes ExecCGI
  AllowOverride All
  Require all granted </Directory>
</Directory>
  1. I have enabled Rewrites in the Admin panel

Magento Admin Panel -> System -> Configuration -> Default Config -> GENERAL -> Web -> Search Engine Optimization -> Use Web Server Rewrites -> Yes

  1. The various XAMPP .htaccess files for my Magento installation using bitnami now point to the following file:

C:\xampp\apps\magento\conf\htaccess.conf

which contains the following Apache directives:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php [L]
</IfModule>

which are the ones advertised on other posts on Stack Overflow.

However when from my main page I click on a category I get a 404

because for instance the page http://myhost.com/magento/mycategory.html

is not found (although http://myhost.com/magento/index.php/mycategory.html is found).

What am I missing from my configuration to get mod_rewrite to work as wanted?

Thanks.

2 Answers 2

2

I've found the answer to my problem.

When I installed Magento via BitNami I specified a base directory of "magento" meaning my magento files were installed to C:\xampp\magento. Because of this, to get rewrites working as needed and get rid of index.php, I was missing the last step which is, inside of C:\xampp\apps\magento\conf\htaccess.conf I still had to uncomment the following line, inside the

<IfModule mod_rewrite.c>

directive:

#RewriteBase /magento/

to

RewriteBase /magento/

This was all that was left. I uncommented the line and restarted Apache and my URLs such as http://myhost.com/magento/mycategory.html began to work.

Thanks.

1
  • OK, I've just done that. Commented Mar 16, 2015 at 21:59
1

Thanks, this way, i troubleshoot problem:

1. Go to the directory of installation C:\xampp\apache\conf

2. Open and edit httpd.conf in a text editor

3. Find the line which contains

*\# LoadModule rewrite_module modules/mod_rewrite.so*

and (uncomment) change to

*LoadModule rewrite_module modules/mod_rewrite.so*

4. Find all occurrences of

*AllowOverride None*

and change to

*AllowOverride All*

I think it appears 2 or 3 times on the configuration file.

5. Restart xampp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.