Re: index.php URL

Denis F. Latypoff latypoff at yandex.ru
Sat Oct 27 17:52:09 UTC 2012


27.10.2012, 21:22, "pattern" <nginx-forum at nginx.us>:
>  !
>
>   www.mydomain.ru    joomla.   URL'
> www.mydomain.ru/index.php
> www.mydomain.ru
> mydomain.ru/index.php
>  
> mydomain.ru
>    :
>
+ server {
+ listen 80;
+ server_name www.mydomain.ru;
+     return 301 http://mydomain.ru$request_uri;
+}

> server {
> listen 80;
- server_name mydomain.ru www.mydomain.ru;
+ server_name mydomain.ru;
> server_name_in_redirect off;
> charset utf-8;
>
> access_log /var/log/nginx/access.mydomain.log main;
> error_log /var/log/nginx/error.mydomain.log info;
>
> root /usr/home/mydomain/public_html;
> index index.php index.html index.htm default.html default.htm;
>
- if ($host = "www.mydomain.ru" ) {
- rewrite ^/(index\.php)?(.*)$ http://mydomain.ru/$2 permanent;
- }
>
- location /index.php {
- rewrite ^/(.*)$ http://mydomain.ru permanent;
+ location = /index.php {
+ return 301 /;
> }
>
> location / {
- try_files $uri $uri/ /index.php?q=$uri&$args;
+ try_files $uri $uri/ /index.php?q=$request_uri;
> }
>
> location ~ \.php$ {
> fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include fastcgi.conf;
> }
> }
>
>  ,   ,     , 
> mydomain.ru/index.php   mydomain.ru. ,  ݣ
>    ,    ?
>

-- 
br, Denis F. Latypoff.



nginx-ru