Welcome! Log In Create A New Profile

Advanced

Re: Rewrite a Shortened URL to a Pretty URL?

Edho Arief
September 01, 2012 01:54PM
On Sun, Sep 2, 2012 at 12:46 AM, slevytam <nginx-forum@nginx.us> wrote:
> Hi,
>
> Thank you for your reply. Sorry for the late response but the forum didn't
> notify me of your post.
>
> I tried your suggestion.
>
> rewrite ^/(.*?)/.*$ /entry/index.php?id=$1 permanent;
>
> It works for http://www.domain.com/1234/pretty-url-goes-here but it does not
> work for http://www.domain.com/1234.
>
> Also, it does not leave the url as entered. So, for example, if you input
> http://www.domain.com/1234/pretty-url-goes-here it changes the address bar
> to http://www.domain.com/entry/id=1234 instead of staying at the pretty
> url.
>
> Any thoughts?
>

rewrite ^/(\d+)(/|$) /entry/index.php?id=$1;

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewrite a Shortened URL to a Pretty URL?

slevytam August 22, 2012 02:23AM

Re: Rewrite a Shortened URL to a Pretty URL?

Edho Arief August 22, 2012 02:32AM

Re: Rewrite a Shortened URL to a Pretty URL?

Javi Lavandeira August 22, 2012 05:08AM

Re: Rewrite a Shortened URL to a Pretty URL?

slevytam September 01, 2012 01:46PM

Re: Rewrite a Shortened URL to a Pretty URL?

Edho Arief September 01, 2012 01:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
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