Welcome! Log In Create A New Profile

Advanced

Help with redirect rules

Posted by earcos 
Help with redirect rules
March 23, 2010 11:16PM
Hello, I am having trouble converting two Apache .htaccess to nginx syntax. They are WordPress MU related. The fist one redirects images uploaded using the regular WP version to the new path on WP MU. The second one allows to create "shortlinks" to be used in social platforms like Twitter.

I can't seem to convert the rules, maybe someone can help me out a bit?

[code]
RewriteRule ^wp-content/uploads/(.*)/(.*)/(.*)\.(.*)$ files/$1/$2/$3.$4 [NC,L]
[/code]

[code]
RewriteRule ^([0-9]+)$ ?p=$1 [R=301,L]
[/code]


Any help will be greatly appreciated :)
Re: Help with redirect rules
March 24, 2010 01:04PM
Have you tried:

[code]
rewrite ^/wp-content/uploads/(.*)/(.*)/(.*)\.(.*)$ /files/$1/$2/$3.$4 last;
rewrite ^/([0-9]+)$ /?p=$1 permanent;
[/code]

Those *should* work.

If not, please post detailed config files.

--
Jim Ohlstein
Re: Help with redirect rules
March 24, 2010 04:34PM
You are completely right :)

Added them to the config file and they work like a charm.

Thank you very much!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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