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 1 of 2
Magento path always contains “index.php” - How to get rid of it? 
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 

Our installation has an “index.php” stuck after the domain for every URL.

http://mystore.net/index.php/product-category/product-subcategory.html

Any idea how this got here and how to get rid of it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
avintel
Sr. Member
 
Total Posts:  147
Joined:  2008-05-15
Southern California
 

i’d double check before you follow my advice but I think you add a mod_rewrite line to you htaccess file to remove .php.

google: mod rewrite htaccess

 
Magento Community Magento Community
Magento Community
Magento Community
 
fastboxgaming
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-10-11
 

you must also turn on rewrite in the configuration.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ravikumar N B
Sr. Member
 
Avatar
Total Posts:  213
Joined:  2009-01-12
 

I modified the “Use Web Server Rewrites” to “Yes” in System->Configuration ->General->Web.
When i click on any product from front end it give 404 error.
Request URL: http://localhost/magento/phone/w900i-sony.html -404 Error
URL : http://localhost/magento/index.php/phone/w900i-sony.html - Shows product.

I think mod_rewirte is not happens here. So i enable the rewrite log(RewriteLog /tmp/rewrite.log) in .htaccess, log file also does not create.
I need to change any modification in .htaccess???

 
Magento Community Magento Community
Magento Community
Magento Community
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 

Ravikumar N B’s config setting advice fixed it! Thanks guys!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ravikumar N B
Sr. Member
 
Avatar
Total Posts:  213
Joined:  2009-01-12
 

Can you explain how to configure this???

 
Magento Community Magento Community
Magento Community
Magento Community
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 

I just changed that one setting and it worked (for the front end, at least; the admin is still freaky, but I don’t care).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ravikumar N B
Sr. Member
 
Avatar
Total Posts:  213
Joined:  2009-01-12
 

Still i am facing same problem.

I think any apache level configuration problem.Because mod_rewirte is not working properly.
i installed my apache using this command

./configure --prefix=/usr/local/httpd-2.0.61/ --enable-so --enable-cgi --enable-info --enable-rewrite --enable-speling --enable-usertrack --enable-deflate --enable-ssl â€“enable-mime-magic

any one can help me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 

Well, for one thing “--enable-speling” is misspelled ... ironically. Not that that has anything to do with your problems.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ravikumar N B
Sr. Member
 
Avatar
Total Posts:  213
Joined:  2009-01-12
 

Ok. How to check mod_rewirte is working or not???

 
Magento Community Magento Community
Magento Community
Magento Community
 
fastboxgaming
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-10-11
 

if you go to your homepage, it will not have index.php at the end if it’s working.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ravikumar N B
Sr. Member
 
Avatar
Total Posts:  213
Joined:  2009-01-12
 

NO.
Without index.php i cant view my site.
Previously it was loaded, because of “DirectoryIndex index.php” configurated in appache httpd.conf.
If i remove from httpd.conf then my website is not loading.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ravikumar N B
Sr. Member
 
Avatar
Total Posts:  213
Joined:  2009-01-12
 

NO.
Without index.php i cant view my site.
Previously it was loaded, because of “DirectoryIndex index.php” configurated in appache httpd.conf.
If i remove from httpd.conf then my website is not loading.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jepsiba
Jr. Member
 
Total Posts:  3
Joined:  2008-04-10
 

Hello everybody ,

I solved my problem with index.php like this:

I enabled the url rewriting in admin->system ->configuration like it is said before in this post, and I also changed my .htaccess.

I am running my website on 1and1 server.

I hope this will help somone.

This is what my htaccess file looks like and it works for me:
You can try and copy and paste all of it, see if that also works for you (do backup your file before, just in case this does not work for you).

############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php

############################################
## GoDaddy specific options

#   Options -MultiViews

## you might also need to add this line to php.ini
##     cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini

############################################
## this line is specific for 1and1 hosting

    AddType x-mapp-php5 .php
    AddHandler x
-mapp-php5 .php

############################################
## default index file

    
DirectoryIndex index.php

<IfModule mod_php5.c>

############################################
## adjust memory limit

    
php_value memory_limit 64M
    php_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

    
php_flag magic_quotes_gpc off

############################################
## disable automatic session start
## before autoload was initialized

    
php_flag session.auto_start off

############################################
## enable resulting html compression

    #php_flag zlib.output_compression on

###########################################
# disable user agent verification to not break multiple image upload

    
php_flag suhosin.session.cryptua off
    
###########################################
# turn off compatibility with PHP4 when dealing with objects
    
    
php_flag zend.ze1_compatibility_mode Off
    
</IfModule>

<
IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload

    
SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>

<
IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter
    #SetOutputFilter DEFLATE

    # Netscape 4.x has some problems...
    #BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    #BrowserMatch ^Mozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    # Don't compress images
    #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    # Make sure proxies don't deliver the wrong content
    #Header append Vary User-Agent env=!dont-vary

</IfModule>

<
IfModule mod_ssl.c>

############################################
## make HTTPS env vars available for CGI mode

    
SSLOptions StdEnvVars

</IfModule>

<
IfModule mod_rewrite.c>

############################################
## enable rewrites

    
Options +FollowSymLinks
    RewriteEngine on

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

   #RewriteBase /magento/

############################################
## workaround for HTTP authorization
## in CGI environment

    
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## always send 404 on missing files in these folders

    
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    
RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond 
%{REQUEST_FILENAME} !-d
    RewriteCond 
%{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    
RewriteRule . /index.php [L]

</IfModule>


############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead

    
AddDefaultCharset Off
    
#AddDefaultCharset UTF-8

<IfModule mod_expires.c>

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

    
ExpiresDefault "access plus 1 year"

</IfModule>

############################################
## By default allow all access

    
Order allow,deny
    Allow from all

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags

    #FileETag none
 
Magento Community Magento Community
Magento Community
Magento Community
 
Freddes
Jr. Member
 
Total Posts:  4
Joined:  2008-03-31
 

Guys, enable rewrites in the gui and
in the .htaccess file you only need to change this:
RewriteRule .* index.php [L]
to:
RewriteRule . /index.php [L]

Hope this works for you. It did for me.... im using Magento version 1.2.1.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
m75131
Jr. Member
 
Total Posts:  2
Joined:  2009-03-11
 

For me this worked:

Admin > System > General > Web > SEO Rewrite turned “on”

In the .htaccess:

I kept the original .htaccess with the exception of configuring the RewriteBase:

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

RewriteBase /clients/xxx

Hope this helps.

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