[TYPO3-50-general] How to remove index.php from the url

Lienhart Woitok Lienhart.Woitok at netlogix.de
Thu May 3 19:56:24 CEST 2012


Hi Visay,

below are the relevant parts from my config:

server {
        server_name  flow3.localhost;

        access_log  /var/log/nginx/flow3.access.log;

        root   /var/www/flow3/Web;

        location / {
                index  index.php;
                try_files       $uri    $uri/   /index.php?$args;
        }

        # Adjusted rewrite rules from FLOW3 .htaccess file
        location ~ "^/(_Resources/Packages/|robots\.txt|favicon\.ico)" {
        }
        location /_Resources {
                rewrite "^(/_Resources/Persistent/[a-z0-9]+/(.+/)?[a-f0-9]{40})/.+(\..+)" $1$3 break;
                rewrite "^(/_Resources/Persistent/.{40})/.+(\..+)" $1$2 break;
        }

        # pass the PHP scripts to FPM listening on unix socket /var/run/php5-fpm.sock
        location ~ \.php$ {
                # This might be different for your setup, that's what works for me with PHP FPM SAPI
                fastcgi_pass    unix:/var/run/php5-fpm.sock;
                fastcgi_index   index.php;
                fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include         fastcgi_params;
                # Set FLOW3 context
                fastcgi_param   FLOW3_CONTEXT   Production;
        #       fastcgi_param   FLOW3_CONTEXT   Development;
                # Tell FLOW3 that we have URL rewriting in place
                fastcgi_param   FLOW3_REWRITEURLS       1;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        location ~ /\.ht {
                deny  all;
        }
}

Sorry for delay, I hope it is still useful to you.

About 500 errors: are those generated by FLOW3 or by nginx? This should be obvious from the error page you are seeing. For nginx errors, have a look in the nginx error log, on ubuntu this is usaly in /var/log/nginx/error.log. FLOW3 also has an error log, in Data/Logs/System.log. The error message there should help to find the problem.

Kind regards,


Lienhart Woitok
Web-Entwickler

Telefon: +49 (911) 539909 - 0
E-Mail: Lienhart.Woitok at netlogix.de
Website: media.netlogix.de
________________________________________
Von: typo3-project-5_0-general-bounces at lists.typo3.org [typo3-project-5_0-general-bounces at lists.typo3.org]" im Auftrag von "Visay Keo [typo3 at visay.info]
Gesendet: Dienstag, 1. Mai 2012 06:27
Bis: typo3-project-5_0-general at lists.typo3.org
Betreff: Re: [TYPO3-50-general] How to remove index.php from the url

Hi Lienhart,

After adding the 2 lines, I always get the 500 Error. Could you check
again and give me your full settings?

Thanks,
Visay

On 04/30/2012 06:08 PM, Lienhart Woitok wrote:
> Hi Visay,
>
> I have such a setup running on my private notebook which is at home while I'm at work. What I can tell you is consequently from memory and untested.
>
> In .htaccess an environment variable FLOW3_REWRITEURLS is defined to tell FLOW3 whether mod_rewrite is available. In nginx this obviously doesn't work out of the box so you have to set this environment variable by hand. I think it is sufficient to add it as fastcgi_param to your fastcgi block, like this:
>
> location ~ \.php$ {
>          # ... (all the other fastcgi things that belong here)
>          fastcgi_param FLOW3_REWRITEURLS 1;
>          fastcgi_param FLOW3_CONTEXT Production;
> }
>
> If it does still not work, feel free to ask me again, so I can look on my notebook how I did it exactly.
>
> Kind Regards,
>
>
> Lienhart Woitok
> Web-Entwickler
>
> Telefon: +49 (911) 539909 - 0
> E-Mail: Lienhart.Woitok at netlogix.de
> Website: media.netlogix.de
>
>
> --
> netlogix GmbH&  Co. KG
> IT-Services | IT-Training | Media
> Andernacher Straße 53 | 90411 Nürnberg
> Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
> E-Mail: info at netlogix.de | Internet: http://www.netlogix.de
>
> netlogix GmbH&  Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
> Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
> Umsatzsteuer-Identifikationsnummer: DE 233472254
> Geschäftsführer: Stefan Buchta, Matthias Schmidt
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: typo3-project-5_0-general-bounces at lists.typo3.org [mailto:typo3-project-5_0-general-bounces at lists.typo3.org] Im Auftrag von Visay Keo
> Gesendet: Montag, 30. April 2012 11:42
> An: typo3-project-5_0-general at lists.typo3.org
> Betreff: [TYPO3-50-general] How to remove index.php from the url
>
> Hi list,
>
> After installing the asian conference site on the server, we found out that the url of the menu always get generated with index.php (e.g:
> http://t3con12-asia.typo3.org/index.php/program/conference.html) and we don't want that.
>
> Does this behaviour come from FLOW3 or the server? It is running on Ngix webserver. The same setup just works fine with nice url on Apache webserver.
>
> Anyone has idea how to fix this problem?
>
> Thanks,
> Visay
>
> --
> Visay Keo
> Certified TYPO3 Integrator
>
> TYPO3 .... inspiring people to share!
> Get involved: http://typo3.org
> _______________________________________________
> TYPO3-project-5_0-general mailing list
> TYPO3-project-5_0-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-5_0-general

--
Visay Keo
Certified TYPO3 Integrator

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
_______________________________________________
TYPO3-project-5_0-general mailing list
TYPO3-project-5_0-general at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-5_0-general


More information about the TYPO3-project-5_0-general mailing list