Nginx rewrite wordpress page -


i have wordpress (example.com) on nginx created page a, has permalink example.com/a . wordpress doesn't have page permalink example.com/b .

i want inner rewrite uri /b show page /a, when user types example.com/b , wp should return page request example.com/a (no 301/302 redirection).

i tried various nginx configurations:

# returns 404 location /b  {     rewrite ^ /a last; }  # returns 302 redirect example.com/a location /b  {     include        fastcgi_params;     fastcgi_pass   unix:/dev/shm/.php-fpm/socket;     fastcgi_index  index.php;     fastcgi_send_timeout 45;     fastcgi_read_timeout 15;     fastcgi_param path_info "/a";     fastcgi_param request_uri "/a";     fastcgi_param  script_filename  $document_root/index.php; }  # same above location /b {     fastcgi_param path_info "/a";     fastcgi_param request_uri "/a"; } 

how can achieved? in advance.

no need put in location {} block, can use

rewrite ^b$ /a last; 

and don't forgot reload nginx after adding rule.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -