rewrite rule custom.php to custom.css

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


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

> it's not redirect. i have .php file, but no .css file.
>
> if in apache, rewrite rule is like this :
>
> <IfModule mod_rewrite.c>
> 	RewriteEngine On
> 	RewriteRule custom.css custom.php [L,QSA]
> </IfModule>
>

It's the other way around:

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

--- appa



More information about the nginx mailing list