Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion SEO Friendly Urls

Received: by 10.68.74.201 with SMTP id w9mr14109247pbv.0.1330824652102;
        Sat, 03 Mar 2012 17:30:52 -0800 (PST)
X-BeenThere: nginxen@googlegroups.com
Received: by 10.68.141.9 with SMTP id rk9ls4083616pbb.9.gmail; Sat, 03 Mar
 2012 17:30:52 -0800 (PST)
Received: by 10.68.189.197 with SMTP id gk5mr8839577pbc.1.1330824652059;
        Sat, 03 Mar 2012 17:30:52 -0800 (PST)
Received: by 10.68.189.197 with SMTP id gk5mr8839576pbc.1.1330824652046;
        Sat, 03 Mar 2012 17:30:52 -0800 (PST)
Return-Path: <nginx-boun...@nginx.org>
Received: from mail.nginx.com (mail.nginx.com. [206.251.255.65])
        by gmr-mx.google.com with ESMTPS id 6si12830006pbg.2.2012.03.03.17.30.51
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sat, 03 Mar 2012 17:30:52 -0800 (PST)
Received-SPF: neutral (google.com: 206.251.255.65 is neither permitted nor denied by best guess record for domain of nginx-boun...@nginx.org) client-ip=206.251.255.65;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 206.251.255.65 is neither permitted nor denied by best guess record for domain of nginx-boun...@nginx.org) smtp.mail=nginx-boun...@nginx.org; dkim=neutral (body hash did not verify) header...@gmail.com
Received: from mail.nginx.com (mail [206.251.255.65])
	by mail.nginx.com (Postfix) with ESMTP id 6FB323FA999;
	Sun,  4 Mar 2012 01:30:47 +0000 (UTC)
X-Original-To: ng...@nginx.org
Delivered-To: ng...@nginx.org
Received: from mail-lpp01m010-f46.google.com (mail-lpp01m010-f46.google.com
	[209.85.215.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
	(Client CN "smtp.gmail.com",
	Issuer "Google Internet Authority" (not verified))
	by mail.nginx.com (Postfix) with ESMTPS id 0AFCC3FA88B
	for <ng...@nginx.org>; Sun,  4 Mar 2012 01:30:43 +0000 (UTC)
Received: by lahj13 with SMTP id j13so4909725lah.33
	for <ng...@nginx.org>; Sat, 03 Mar 2012 17:30:35 -0800 (PST)
Received-SPF: pass (google.com: domain of wtym...@gmail.com designates
	10.152.128.202 as permitted sender) client-ip=10.152.128.202;
Received: from mr.google.com ([10.152.128.202])
	by 10.152.128.202 with SMTP id nq10mr14041814lab.11.1330824635277
	(num_hops = 1); Sat, 03 Mar 2012 17:30:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=wkeR4MfdnHKULp1GnOEoabtWgE/HfFQkKl41jo/CUhU=;
	b=QAOW0WDZQRDJVvZrUlw4GLNqUHRzGcQH37QUzbbJZ+GtYzMAylLVIuIAQaR8Ni2QkC
	uioo1MX6nAC/n+QyZaX7lDMNN+ndclur4gFxwGi69zFO8841U5VcUMzOOuY3I0Iv1pyi
	Wt93Vwp+1eujv7e1TheFPl8nKPZnNUay81AokHcbOZb/mMQVdft5721WPdpbYJAUfTAp
	fJMfzYqsFELS7BkGTaHtxak8PSoKPUR2lpfWi6M0NBjcYzLM6jit+eo4Nth5zl1ci2nj
	t/YBpdjsKun7hdUuYAzQHbwXAJPuV2fg2imNi4eGyRhoB3s18sgYdCpl0t1hX1qLJnjh
	/T1Q==
MIME-Version: 1.0
Received: by 10.152.128.202 with SMTP id nq10mr11546786lab.11.1330824635127;
	Sat, 03 Mar 2012 17:30:35 -0800 (PST)
Received: by 10.112.92.3 with HTTP; Sat, 3 Mar 2012 17:30:35 -0800 (PST)
Date: Sat, 3 Mar 2012 20:30:35 -0500
Message-ID: <CANP8N5FJK9Nd5FJb8srupbv79CGMukijNpsy8yCF32bTNzF...@mail.gmail.com>
Subject: SEO Friendly Urls
From: adam estes <wtym...@gmail.com>
To: ng...@nginx.org
X-BeenThere: ng...@nginx.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: ng...@nginx.org
List-Id: "nginx mailing list \[English\]" <nginx.nginx.org>
List-Unsubscribe: <http://mailman.nginx.org/mailman/options/nginx>,
	<mailto:nginx-requ...@nginx.org?subject=unsubscribe>
List-Archive: <http://mailman.nginx.org/pipermail/nginx>
List-Post: <mailto:ng...@nginx.org>
List-Help: <mailto:nginx-requ...@nginx.org?subject=help>
List-Subscribe: <http://mailman.nginx.org/mailman/listinfo/nginx>,
	<mailto:nginx-requ...@nginx.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: nginx-boun...@nginx.org
Sender: nginx-boun...@nginx.org

I'm attempting to use Nginx to server a CodeIgniter Script.

Code Igniter uses SEO Friendly scripts (AKA, only uses / instead of ?)

This works fine when I try and use it on Apache. Trying to setup my
own VPS with Code Igniter through NGINX only leans to a pain.

The server is setup with the base folder being a phpbb form, and a
codeigniter script in the folder /fg152/

I'm trying to get the nginx to recognize that index.php/login is
supposed to be a query for code igniter, not a file of its own.

I tried every configuration on this link.

http://codeigniter.com/forums/viewthread/90231/

My current Nginx conf looks like this.


                location /fg152/ {
                        root /home/sites/domain/fg152/;
                        index index.php;
                        try_files $uri $uri/ /fg152/index.php;

                }


                location / {
                        root /home/sites/domain/;
                        index index.php index.html index.htm;
                        # PHPBB SEO REWRITE RULES - ADVANCED
                        # AUTHOR : dcz www.phpbb-seo.com
                        # STARTED : 01/2006

                        rewrite
^/(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$
/viewforum.php?f=$2&start=$4 last;
                        rewrite
^/(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$
/viewtopic.php?f=$2&t=$4&start=$6 last;
                        rewrite
^/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$
/viewtopic.php?forum_uri=$1&t=$3&start=$5 last;
                        rewrite
^/resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$
/download/file.php?id=$2&t=$1 last;
                        rewrite ^/member/([^/]+)/?$
/memberlist.php?mode=viewprofile&un=$1 last;
                        rewrite
^/member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$
/search.php?author=$1&sr=$2&start=$4 last;
                        rewrite
^/(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$
/memberlist.php?mode=group&g=$2&start=$4 last;
                        rewrite ^/post([0-9]+)\.html$ /viewtopic.php?p=$1 last;
                        rewrite ^/active-topics(-([0-9]+))?\.html$
/search.php?search_id=active_topics&start=$2&sr=topics last;
                        rewrite ^/unanswered(-([0-9]+))?\.html$
/search.php?search_id=unanswered&start=$2&sr=topics last;
                        rewrite ^/newposts(-([0-9]+))?\.html$
/search.php?search_id=newposts&start=$2&sr=topics last;
                        rewrite ^/unreadposts(-([0-9]+))?\.html$
/search.php?search_id=unreadposts&start=$2 last;
                        rewrite ^/the-team\.html$
/memberlist.php?mode=leaders last;
                        rewrite
^/([a-z0-9_-]+)/?(page([0-9]+)\.html)?$
/viewforum.php?forum_uri=$1&start=$3 last;
                        rewrite
^/.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /$1
last;
 if (!-e $request_filename) {
                                rewrite
^/([a-z0-9_/-]+)/?(page([0-9]+)\.html)?$
/viewforum.php?forum_uri=$1&start=$3 last;
                                break;
                        }
                        # END PHPBB PAGES
                }

                location ~ \.php$ {
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        # A handy function that became available in 0.7.31 that breaks down
        # The path information based on the provided regex expression
        # This is handy for requests such as file.php/some/paths/here/

                        fastcgi_param  PATH_INFO          $fastcgi_path_info;
                        fastcgi_param  PATH_TRANSLATED
$document_root$fastcgi_path_info;

                        fastcgi_param  QUERY_STRING       $query_string;
                        fastcgi_param  REQUEST_METHOD     $request_method;
                        fastcgi_param  CONTENT_TYPE       $content_type;
 fastcgi_param  CONTENT_LENGTH     $content_length;

                        fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
                        fastcgi_param  SCRIPT_FILENAME
$document_root$fastcgi_script_name;
                        fastcgi_param  REQUEST_URI        $request_uri;
                        fastcgi_param  DOCUMENT_URI       $document_uri;
                        fastcgi_param  DOCUMENT_ROOT      $document_root;
                        fastcgi_param  SERVER_PROTOCOL    $server_protocol;

                        fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
                        fastcgi_param  SERVER_SOFTWARE    nginx;

                        fastcgi_param  REMOTE_ADDR        $remote_addr;
                        fastcgi_param  REMOTE_PORT        $remote_port;
                        fastcgi_param  SERVER_ADDR        $server_addr;
                        fastcgi_param  SERVER_PORT        $server_port;
                        fastcgi_param  SERVER_NAME        $server_name;
                        fastcgi_pass unix:/etc/phpcgi/php-cgi.socket;
                        fastcgi_index index.php;
                        }


Now. This lets the script work. Instead of giving 404 on
/fg152/index.php/login it shows the login page. EXCEPT the images do
not log. Huge problem there.

The images are located at /fg152/application/views/images/

And the login.php that its calling is located at /fg152/application/controllers/

If I remove the location /fg152/ it will show up with the image files
again (But the rest gets a 404 error

I've tried using

location /fg152r/ {

        if (-f $request_filename) {
            expires max;
            break;
        }

        if (!-e $request_filename) {
            rewrite ^/fg152/(.*)$ /fg152/index.php/$1 last;
        }
    }

Still no luck. What can I do to resolve this issue and get both php
and image files working?

_______________________________________________
nginx mailing list
ng...@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx