Support

Admin Tools

#27423 nginx - Homepage /index.php

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Thursday, 27 April 2017 17:17 CDT

extly
 Hi,

I've migrated a server to nginx, and everything works great.

However, I've noticed that, by default, the generated nginx.conf redirects the Homepage to /index.php.

I've been unable to find an option or documentation about how to disable the redirection and keep it on the standard https://www.mydomain.com.

Your site doesn't redirect, so I guess there's some way to implement it.

Please could you send me the tip to configure it.

Regards,

extly
I guess, it is related to this declaration:

# Allow access to
location ~* ^/$ {
        return 301 /index.php;
}

tampe125
Akeeba Staff
Hello,

did you take a look at official Joomla documentation about NginX? https://docs.joomla.org/Nginx

Davide Tampellini

Developer and Support Staff

๐Ÿ‡ฎ๐Ÿ‡นItalian: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: good โ€ข ๐Ÿ• My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

extly
Hi,

Yes, I have checked it.

Regards,

nicholas
Akeeba Staff
Manager
Set "Enable SEF URLs" to Yes and create the new .htaccess.

The bit of code you are referring to is actually part of the following stanza:
# Allow access to the front-end index.php file
location ~* ^/$ {
	return 301 /index.php;
}
location ^/index.php$ {
	$fastcgi_pass_block
	break;
}

Where $fastcgi_pass_block is the configured code to tell NginX to pass the file through FastCGI.

This is a side-effect of NOT wanting to use SEF URLs: everything must go through your site's index.php file, including the site's root. Otherwise NginX would try to create a folder index (and in some cases fail, which is the secondary reason for the recirect). This would make / and /index.php appear as two different URLs to search engines, leading to duplicate content issues. So we have to redirect / to /index.php to avoid this issue.

Nicholas K. Dionysopoulos

Lead Developer and Director

๐Ÿ‡ฌ๐Ÿ‡ทGreek: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: excellent ๐Ÿ‡ซ๐Ÿ‡ทFrench: basic โ€ข ๐Ÿ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!