Question nginx rewrites

andyxyz

Basic Pleskian
Server operating system version
Ubuntu 22.04
Plesk version and microupdate number
Version 18.0.61 Update #6
I am trying to do a very simple removal of index.php from a url using nginx only config.

eg


The standard code

location ~* ^/index\.php/(.*)$ { return 301 /$1;}
has no effect in Additional nginx settings and has to be placed within the server block .. which of course will not survive a rebuild.
this seems a spectacularly straight forward request.. how are people doing this?
 
Not sure why you would need a custom template for this. Any Nginx directive you add to the Additional Nginx directive gets added to the server block already.

Most common directive for beautifying links/permalinks look something like:
NGINX:
location / {
            try_files $uri $uri/ /index.php?$args;
}
The exact implementation depends on your website/application.
 
Not sure why you would need a custom template for this. Any Nginx directive you add to the Additional Nginx directive gets added to the server block already.

Most common directive for beautifying links/permalinks look something like:
NGINX:
location / {
            try_files $uri $uri/ /index.php?$args;
}
The exact implementation depends on your website/application.
Tried that 1st.. no effect at all.
 
Back
Top