Welcome! Log In Create A New Profile

Advanced

Simple URI redirection / alias in Nginx…

May 30, 2011 09:40AM
Please, how can I make this simple operation:

I wish that every requests for uris like:
http://example.com/adm
or:
http://example.com/adm
Goes to the wordpress login page:
wordpress/wp-login.php
(The wordpress installation is inside the folder "wordpress").

I've tried:

location /adm/ { alias wordpress/wp-login.php; }
location /adm { alias wordpress/wp-login.php; }

and:

rewrite ^/adm$ wordpress/wp-login.php;

But with no success...

Just in case someone asks, this is my serve conf. file:

server {
server_name www.example.com;
rewrite ^ http://example.com$request_uri? permanent;
}

server {
server_name example.com;

access_log /var/log/nginx/example.com.access;
error_log /var/log/nginx/example.com.error;

root /var/www/example.com;

index index.htm index.php;

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

location ~ .php$ {
try_files $uri =404;
#fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}

location = /favicon.ico {log_not_found off;access_log off;}
location = /robots.txt {allow all;log_not_found off;access_log off;}
location ~ /\. {deny all;access_log off;log_not_found off; }
}
Subject Author Posted

Simple URI redirection / alias in Nginx…

atipico May 30, 2011 09:40AM

Re: Simple URI redirection / alias in Nginx…

Igor Sysoev May 30, 2011 02:48PM

Re: Simple URI redirection / alias in Nginx…

atipico May 30, 2011 07:03PM

Re: Simple URI redirection / alias in Nginx…

Igor Sysoev May 30, 2011 10:12PM

Re: Simple URI redirection / alias in Nginx…

atipico June 01, 2011 08:20AM

Re: Simple URI redirection / alias in Nginx…

pk899 May 30, 2011 06:56PM

Re: Simple URI redirection / alias in Nginx…

pk899 May 30, 2011 06:57PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 285
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready