Jump to content

[Solved] Why domainname not the same as my preview and jump to default


Angelino
 Share

Recommended Posts

I got a website like www.example.com/nl/ also on /en/ /fr/. Now if i'm in processwire making my content and want to see my preview on the SAVE button like save + view then the preview jumps to https://default/nl/....../ and not my domainname? My main language is /nl/ ofcourse. Anything i missed in the settings? I set my $config->httpHosts already filled in my domains.

Link to comment
Share on other sites

My apologies; there was a misconfiguration in my Nginx settings:

server_name default;

I changed it on the server to the correct domain:

server_name example.com www.example.com;

Now it works, and previews from ProcessWire are directed to the correct URL.

Link to comment
Share on other sites

  • Angelino changed the title to [Solved] Why domainname not the same as my preview and jump to default

@Alpina Here is my `nginx.conf`file:

server {
    listen 80;
    server_name default; # Here you need to change default with your site

    root /var/www/html;  # Ensure this path is correct and points to the ProcessWire files
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~ /\.ht {
        deny all;
    }
}

and my compose.yml nginx

  nginx:
    container_name: nginx
    image: nginx:alpine
    ports:
      - "80:80"
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
      - ../code/:/var/www/html  # here is ../code my root folder
    depends_on:
      - php
      - mysql
    networks:
      - boilerplate # this is custom, your network need to come here

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...