Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 3
How do I remove “index.php” in url? 
 
Rooni
Sr. Member
 
Total Posts:  87
Joined:  2009-03-25
England
 

hello there in my htaccess file there is nothing its 0KB what is the problem is it ok or its not ok

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tutti
Member
 
Total Posts:  33
Joined:  2009-02-17
 

I followed kiatng instructions and it worked perfectly! Thanks!

To the rest of you: the config file is probably in /etc/apache2/sites-available/default

 
Magento Community Magento Community
Magento Community
Magento Community
 
Fery
Jr. Member
 
Total Posts:  1
Joined:  2010-02-20
 
anderl - 22 May 2009 12:00 PM

My .htaccess file had the following entry:

############################################
## you can put here your magento root folder
## path relative to web root

#RewriteBase /magento/

I deleted # and magento/
So my new row looks like
RewriteBase /

And so that works.

Greeting
Andi

I follow this and it’s works !!
But my .htaccess a little different : RewriteBase /magento/

because my root is /magento/

tq all

 
Magento Community Magento Community
Magento Community
Magento Community
 
GFEMajor
Sr. Member
 
Total Posts:  138
Joined:  2010-01-11
 
kiatng - 12 November 2008 06:53 AM

I finally resolved the problem after many hours.  After reading about .htaccess a bit in http://httpd.apache.org/docs/2.0/howto/htaccess.html, I realized that there might be some other configuration files that I needed to check.  It turned out that the site configuration file in /etc/apache2/sites-available had the AllowOverride directive set to None. I edited this to “AllowOverride All”, restarted apache2, and voila, it works!

resolved the problem for me. Thank you very very mutch

 
Magento Community Magento Community
Magento Community
Magento Community
 
Artega Imports
Sr. Member
 
Avatar
Total Posts:  78
Joined:  2010-02-03
Liverpool, England, UK
 

For the fastest and most simplest way to solve this

Navigate to Magento Admin

System/Configuration/Web: Use Web Server Rewrites YES.

Done wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
webscot
Sr. Member
 
Total Posts:  192
Joined:  2009-05-12
 

We are trying to eliminate the index.php from our store URL in transactional emails:

<a href="{{store url=""}}">

It interferes with other URLs we want to include in our transactional emails when using the coding above.

Our URL rewrites are already turned on in the Admin backend. We tried commenting out this Rewrite Rule in our .htaccess file and it did not help.

## rewrite everything else to index.php

    RewriteRule .* index.php [L]

</IfModule>

We also attempted remove the comment for

RewriteBase /
after removing /magento/ and this also did not correct the problem.

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Artega Imports
Sr. Member
 
Avatar
Total Posts:  78
Joined:  2010-02-03
Liverpool, England, UK
 

I would clear all my chaches first and then reindex data.

Not sure if this would help but you might have overlooked it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
osexylingerie
Jr. Member
 
Total Posts:  3
Joined:  2010-04-06
 

I had the same issue, my home page kept getting /index.php at the end of it when I clicked on Home or continue shopping. The issue was resolved with just a switch of an option to ENABLE. I went to SYSTEM>Configuration>Web>

1-Use Web Server Rewrites (YES)
2-Redirect to Base URL if requested URL doesn’t match it (Yes)

and that was it ...

This worked for me

 
Magento Community Magento Community
Magento Community
Magento Community
 
webscot
Sr. Member
 
Total Posts:  192
Joined:  2009-05-12
 

@osexylingerie

So are you stating that in your transactional emails you don’t get the index.php at the end of your {{store_url}}?

We don’t have the problem on our website front end either. The problem is in Transactional Emails.

 
Magento Community Magento Community
Magento Community
Magento Community
 
webscot
Sr. Member
 
Total Posts:  192
Joined:  2009-05-12
 

PROBLEM SOLVED:

Thank you to aheadWorks for providing this solution.

We did not have a problem with index.php appearing anywhere else except for TRANSACTIONAL EMAILS (TEs).

We wanted the base url to appear without the “index.php” interfering in our URLs, so we could add other footer information to our TEs. This way the URL remains consistent whether we are in a live or development environment.

We applied this solution and it works great! (until Varien changes things and then it won’t work of course...) smile

{{config path="web/unsecure/base_url"}}
instead of
{{store url=""}}
 
Magento Community Magento Community
Magento Community
Magento Community
 
moobaa
Sr. Member
 
Total Posts:  171
Joined:  2009-10-05
 
Tutti - 07 October 2009 01:36 AM

I followed kiatng instructions and it worked perfectly! Thanks!

To the rest of you: the config file is probably in /etc/apache2/sites-available/default

Did all of this, and still having issues. However, uppon changing the DEFAULT file, instead of getting 404s, I now get 500s.

Any clues?

The .htaccess solution works fine in a shared environment, but if you are on a VPS/Dedicated then there seems to be some more technicalities to it.

How I hate to love Magento.

Cheers.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tarbantinbookstore
Jr. Member
 
Total Posts:  12
Joined:  2010-07-31
 
Sindre|ProperHost - 05 November 2008 07:21 AM

That might be the problem. Try to enable url rewrites and see if that solves it. You need mod_rewrite enabled on your server.

thanks, you solved my problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
blaines.insane
Jr. Member
 
Total Posts:  3
Joined:  2011-01-05
 

Pardon me for being such a complete idiot… But I followed all these suggestions and had no luck. I was making change after change, after which I would refresh my page at http://mystore.com/index.php/ . It finally dawned on me that of course the /index.php/ wasn’t going to go away, regardless of any rewrites as long as it was physically typed into the address bar. DOH! Take that off, and voila! all is well. Hope that helps someone. wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
alternativefootwear
Jr. Member
 
Total Posts:  3
Joined:  2010-11-04
 

HI,
having tried all of the above.. this may seem like a really stupid question but…

the html pages dont actually exist.

for example http://www.mydomain/myproduct.html doesnt exist when i look via ftp.

why?

thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
salimkureshi
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2011-02-10
Baroda
 

[b]Resolve this problem follow steps[/b]

How to remove index.php from Magento URLs using .htaccess

1) Login to admin section by using the URL http://domain.com/index.php/admin

2) then go to “System >> Configuration >>Web >> Search Engines Optimization”

Use Web Server Rewrites : YES

3) Go to “System >> Configuration >>Web >>Secure”

Use secure URL Frontend: YES (Optional)

4) Then create the .htaccess file under your the magento installed folder.

If the magento installed under document root ( /home/username/public_html) then add follogig rules into .htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase 
/
RewriteRule ^index\.php$ - [L]
RewriteCond 
%{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
. /index.php [L]
</IfModule>

and If the magento installed under /shop or directory then add the following rules into ” /home/username/public_html/shop/.htaccess ” file.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase 
/shop/
RewriteRule ^index\.php$ - [L]
RewriteCond 
%{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
. /shop/index.php [L]
</IfModule>

http://www.salimkureshi.wordpress.com

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 3