rewrite rule custom.php to custom.css

António P. P. Almeida appa at perusio.net
Wed Jan 4 14:28:07 UTC 2012


On 4 Jan 2012 14h12 WET, nginx-forum at nginx.us wrote:

> hi,
>
> how can i rename custom.php to custom.css for my wordpress custom
> css.

You mean rewrite or redirect I suppose.

> let say i put my custom.php inside my theme folder
>
> http://example.com/wp-content/themes/mytheme/assets/css/custom.php

Try:

location ^~ /wp-content/themes/mytheme/assets/css/custom.php {
         return 302 /wp-content/themes/mytheme/assets/css/custom.css;
}

--- appa



More information about the nginx mailing list