Pretty URLs on Nginx? Howto??

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
jradxl
New Member
New Member
Posts: 1
Joined: Thu Jan 21, 2021 12:27 am

Pretty URLs on Nginx? Howto??

Post by jradxl »

The documentation at:
https://docs.cmsmadesimple.org/configuration/pretty-url

when using other webserver, in my case, Nginx to add at end config.php:-

Code: Select all

$config['url_rewriting'] = 'internal';
The above is straightforward.

It then says:-

Code: Select all

Step 2
The head section of your HTML template should contain the tag:
{metadata}
Which I don't understand.
I'm using the free bandb design

Where do I add this?
Via Admin?
or am I supposed to edit a file?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Pretty URLs on Nginx? Howto??

Post by DIGI3 »

The {metadata} tag is already in the bandb_master template.
Not getting the answer you need? CMSMS support options
jradxl
New Member
New Member
Posts: 1
Joined: Thu Jan 21, 2021 12:27 am

Re: Pretty URLs on Nginx? Howto??

Post by jradxl »

Many thanks for reply.

I have now sorted out my URLs without the "index.php" running on Nginx, as follows...
1. Was using Vivaldi browers on Ubuntu 20.10, and it was giving me strange urls.
The problem isn't using Firebox and Chrome.

2.Yes, {metadata}, is in the bandb_master template, which can be found in Admin, at the path, Layout > Design Manager, then select "bandb_master" in the first Template tab, and it's a few lines down near <head>

2. My Config.php looks like this. Note that 'url_rewriting' = 'mod_rewrite', because I'm using a Nginx statement that emulates that on Apache.

Code: Select all

$config['assume_mod_rewrite'] = 'false';
$config['page_extension'] = '';
$config['use_hierarchy'] = 'false';
$config['url_rewriting'] = 'mod_rewrite';
$config['internal_pretty_urls'] = 'false';
$config['root_url'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . '/cmsms';
3.My Nginx site.conf has this:-

Code: Select all

location /cmsms
    {
        try_files $uri $uri/ /cmsms/index.php?page=$request_uri;
    }
4. A URL on my test site looks like this:-

Code: Select all

http://www.XXXX.dynu.net/cmsms/news/1/1/News-Info
It was definitely Vivaldi that was confusing this issue.
Hope this helps anyone searching in the future.
Suggest the documentation is enhanced to make it easier for beginners
Last edited by jradxl on Fri Jan 22, 2021 12:52 am, edited 2 times in total.
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm
Location: Helsinki, Finland

Re: Pretty URLs on Nginx? Howto??

Post by KO »

I have that typical

Code: Select all

$config['url_rewriting'] = 'mod_rewrite';
in config.php and

Code: Select all

location / {
     try_files $uri $uri/ /index.php?page=$request_uri ;
}
in NGINX settings for that domain. Pretty URLs work perfectly fine :)

Please look at here https://www.nginx.com/resources/wiki/st ... de_simple/
Post Reply

Return to “Layout and Design (CSS & HTML)”