SEO Friendly Urls

Cliff Wells cliff at develix.com
Sun Mar 4 02:33:31 UTC 2012


On Sat, 2012-03-03 at 20:30 -0500, adam estes wrote:
> 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;
> 
>                 }


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


Try this instead:

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

Remember that the location is appended to the root, so your
configuration would lead to /home/sites/domain/fg152/fg152, which I
don't think is what you intended.

Regards,
Cliff



More information about the nginx mailing list