Not Solved nginx full virtual host configuration compatible with google seo plugin
#1
Not Solved
Hi,

does any one could share here working full Nginx Virtual Host configuration for MyBB ?

I`m searching since few hours for it but I havent found anything which is working with Google Seo plugin.



I found only some rewrite rules... but its not working for me.


I will appreciate full Virtual Host (domain) configuration with properly configured rewriting rules.
(.htaccess was not designed for Nginx)


Thanks in advance for Your support.



Cheers
Dlugasny
Reply
#2
Not Solved
This is probably what you're looking for;
server {
    listen 80
    server_name example.com;
 
    root /var/www/html/
    index index.html index.php;
 
    location / {
        rewrite ^/([^&]*)&(.*)$ https://example.com/$1?$2 permanent;
        rewrite ^/((?i)sitemap-([^./]+)\.xml)$ /misc.php?google_seo_sitemap=$2;
        rewrite ^/((?i)Forum-([^./]+))$ /forumdisplay.php?google_seo_forum=$2;
        rewrite ^/((?i)Thread-([^./]+))$ /showthread.php?google_seo_thread=$2;
        rewrite ^/((?i)Announcement-([^./]+))$ /announcements.php?google_seo_announcement=$2;
        rewrite ^/((?i)User-([^./]+))$ /member.php?action=profile&google_seo_user=$2;
        rewrite ^/((?i)Calendar-([^./]+))$ /calendar.php?google_seo_calendar=$2;
        rewrite ^/((?i)Event-([^./]+))$ /calendar.php?action=event&google_seo_event=$2;
        try_files $uri $uri/ /index.php?$args;
    }
}
Reply
#3
Not Solved
Kawaii - thank You very much Smile

Tomorrow morning I will implement it and will check if its working.

As I see, these are rules for forum installed in the root of the domain:

https://somedomain.com/index.php right ?
Reply
#4
Not Solved
Yes, that's correct.
Reply
#5
Not Solved
(2019-01-22, 06:33 PM)kawaii Wrote: This is probably what you're looking for;
server {
    listen 80
    server_name example.com;
 
    root /var/www/html/
    index index.html index.php;
 
    location / {
        rewrite ^/([^&]*)&(.*)$ https://example.com/$1?$2 permanent;
        rewrite ^/((?i)sitemap-([^./]+)\.xml)$ /misc.php?google_seo_sitemap=$2;
        rewrite ^/((?i)Forum-([^./]+))$ /forumdisplay.php?google_seo_forum=$2;
        rewrite ^/((?i)Thread-([^./]+))$ /showthread.php?google_seo_thread=$2;
        rewrite ^/((?i)Announcement-([^./]+))$ /announcements.php?google_seo_announcement=$2;
        rewrite ^/((?i)User-([^./]+))$ /member.php?action=profile&google_seo_user=$2;
        rewrite ^/((?i)Calendar-([^./]+))$ /calendar.php?google_seo_calendar=$2;
        rewrite ^/((?i)Event-([^./]+))$ /calendar.php?action=event&google_seo_event=$2;
        try_files $uri $uri/ /index.php?$args;
    }
}

this doesn't work, when clicking a user profile the URL is displayed as domain.com/Username but clicking it simply takes you to the index.php of the forum root.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)