Jump to content

/index.php added after the domain name


Recommended Posts

Hello,
I have this strange problem with Prestashop 1.5.6.1.
When I type the address of the website, after the address automatically is added '/index.php'.
Nothing bad at first sight, but the dynamic links from the mails are loaded like this one: 

http://website.com/index.phpmy-account.php

instead of

http://website.com/my-account.php

In result the page could not be opened.

 

I know this must be something simple, but I am tired to dig over the Internet about it, so please, if somebody knows what it is, help!

Link to comment
Share on other sites

back office-->preferences-->seo & urls

 

edit 'Page' index

 

remove friendly URL (requires mod_rewrite and friendly urls to be active)

 

I have seen many similar topics in internet, but it seems to be not the real cause of my problem.

The domain name is clear without any /index.php behind

 

 attachicon.gifScreen Shot 2013-12-11 at 10.09.26 AM.png

Link to comment
Share on other sites

Friendly URL is not enabled by default.

After deletion index page by default positioned on 4-th position nothing changed the picture.

 

I will try to inspect the apache config for any case, but i doubt is that, because I have already running another older prestashop with similar config without any issues.

 

I even temporary removed the .htaccess file in the root dir if for some reason is messing with my website and no luck.

Link to comment
Share on other sites

I will try to provide you with little more info.

Here is a list of the configuration if that could help:

 

Captured from the presta

Server information
Server information: Linux #87-Ubuntu SMP Tue Nov 12 21:38:12 UTC 2013 i686
Server software version: Apache/2.2.22 (Ubuntu)
PHP version: 5.3.10-1ubuntu3.8
Memory limit: 128M
Max execution time: 300
Database information
MySQL version: 5.5.34-0ubuntu0.12.04.1
MySQL engine: InnoDB
Tables prefix: ps_

Apache virtual host config

<VirtualHost *:80>                                                                 
<------>ServerAdmin webmaster@localhost                                            
<------>ServerName domain.com                                                 
<------>ServerAlias www.domain.com                                            
                                                                                   
<------>DocumentRoot /var/www/Site_Root/                                         
<------><Directory />                                                              
<------><------>Options FollowSymLinks                                             
<------><------>AllowOverride none                                                 
<------></Directory>
<------><Directory /var/www/Site_Root>
<------><------>Options Indexes FollowSymLinks MultiViews
<------><------>AllowOverride None
<------><------>Order allow,deny
<------><------>allow from all
<------></Directory>

<------>ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<------><Directory "/usr/lib/cgi-bin">
<------><------>AllowOverride None
<------><------>Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
<------><------>Order allow,deny
<------><------>Allow from all
<------></Directory>

<------>ErrorLog /var/log/apache2/error.log

<------>LogLevel warn

<------>CustomLog /var/log/apache2/access.log combined
<------>ServerSignature On

</VirtualHost>

mod rewrite is enabled and it's working well I am using it as https redirection.

 

I tried to temporary remove .htaccess file from site's root dir and then 'apache2ctl restart' and the index.php was still there.

 

"AllowOverride all" is not my solution, I have inspected my config and there is nothing about index.php there and everything seems to be normal there.

 

I am not planing use friendly URL at least for now I strive to start it.

My main problem is the mail links that lead to nowhere.

 

The presta itself returns each time on any level http://shopdomain.com/index.php, no matter if you type the address in the browser or you have been sent by some of the links from the mails.

 

Thank you so far guys, if somebody have an idea how I can solve it don't hesitate. 

Link to comment
Share on other sites

without friendly url's then you will need to use a solution outside of PrestaShop, i.e. with friendly url's you can control the url rewrite from back office then without friendly url's then PrestaShop is going to build, in this example index.php...it has no choice.

 

I found this a nice article on the subject, hope it helps and is pertinent to your issue

 

http://ellislab.com/expressionengine/user-guide/urls/remove_index.php.html

Link to comment
Share on other sites

I tried the .htaccess method from that article and I was amazed that it didn't change nothing.

Here is the code that I put alone in .htaccess file, just copy/pasted it from the website.

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Continue digging ...

Link to comment
Share on other sites

Automatically redirect to the canonical URL "No"

enabled.gif  Yes disabled.gif  No

Recommended, but your theme must be compliant.

 

 

Disable apache multiviews "Yes"

enabled.gif  Yes disabled.gif  No

Enable this option only if you have problems with URL rewriting.

 

 

Here it is my solution, it works only in this combination.

I knew that it must be something not very complicated.

Thanks to anybody involved.

 

ps: another helpful tip to those who use translated emails, there is a new set of variables in the website links, I guess some of the translated mails are copied from older versions of prestashop.

For instance {shop_url}history.php is now {history_url} and the rest of them goes the same way.

Edited by IGNITER (see edit history)
  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...