Nginx and Static Page Permalinks
-
I’ve recently migrated from Apache 2 to Nginx. After the migration, I was able to get (pretty) Permalinks working for my posts. been able to get Permalinks working.
I’ve had no such success at getting Permalinks to work on my static pages, e.g. https://www.seeuncharted.com/contact/
I have searched exhaustively for others who have experienced this, and a resolution. In my searches, I have found nothing that reflects my specific problem. I find it quite interesting that many people have not reported this issue.
I’m trying to do the following:
1. https://www.seeuncharted.com/contact
When I click on this link I’m directed to my theme’s ‘404 Not Found’ page. After resetting Permalinks to ‘default ‘, I’m able to access my contact page at: https://www.seeuncharted.com/?page_id=1195
Is there code I can put in my config file to resolve the static page Permalinks issue I’m experiencing?
Below is a sample of my config file:
`server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /path/to/root
index index.php;server_name seeuncharted.com https://www.seeuncharted.com;
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$request_uri;#Yoast sitemap
location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ {
rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent;
rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last;
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;## following lines are options. Needed for wordpress-seo addons
rewrite ^/news_sitemap\.xml$ /index.php?sitemap=wpseo_news last;
rewrite ^/locations\.kml$ /index.php?sitemap=wpseo_local_kml last;
rewrite ^/geo_sitemap\.xml$ /index.php?sitemap=wpseo_local last;
rewrite ^/video-sitemap\.xsl$ /index.php?xsl=video last;access_log off;
}location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
expires max; log_not_found off; access_log off;}
}
- The topic ‘Nginx and Static Page Permalinks’ is closed to new replies.