News:

Join the Facebook Fan Page.

Main Menu

Pretty URLs

Started by SMFHacks.com Team, January 31, 2007, 10:56:43 AM

Previous topic - Next topic

SMFHacks.com Team

Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

gaurav09

Quote from: SMFHacks.com Team on July 21, 2014, 02:21:48 PM
Updated for SMF 2.0.8
Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

aceone

I have a strange problem recently. If I enable Pretty Urls all seam to work fine but I can't post anything!

I'm Using Nginx with this config:

http://pastebin.com/385Z8ZY6 [nofollow]

When Pretty Urls is enable, I can't Post anything, it just shows up a blank form again.
When I press submit I get these in the Logs:
"GET /aktuelles/?action=post2;start=0;msg=9951;a07598183=c3c9c0d7eec4832d38046bc1a16242c7 HTTP/1.1" 302 5 "-" "-"
"GET /aktuelles/?action=post HTTP/1.1" 200 43073 "-" "-"

Without Pretty Urls it works and I get this:
"POST /index.php?action=post2;start=0;msg=9951;a07598183=c3c9c0d7eec4832d38046bc1a16242c7;board=4 HTTP/1.1" 302 5 "https://example.com/index.php?action=post;msg=9951;topic=3460.0 [nofollow]" "-"
"GET /index.php?topic=3460.msg9951 HTTP/1.1" 200 33382 "https://example.com/index.php?action=post;msg=9951;topic=3460.0 [nofollow]"


ExSpirit

I am using this mod on my SMF 2.0.8 and it works OK, but there is one problem at child forums. This is structure of my forum:

QuoteNews
General info
- Product
- Service
Technical info
- Product
- Service
Other

So the URLs for those boards are:

Quotehttp://forumdomain/news/
http://forumdomain/general-info/
http://forumdomain/product/
http://forumdomain/service/
http://forumdomain/technical-info/
http://forumdomain/product-14/
http://forumdomain/service-15/
http://forumdomain/other/

As you can see some names repeat so it adds number to the end and that would be OK, but the problem is that some child forum shouldn't be shown as it own but under parent, so URLs should be something like:

Quotehttp://forumdomain/news/
http://forumdomain/general-info/
http://forumdomain/general-info/product/
http://forumdomain/general-info/service/
http://forumdomain/technical-info/
http://forumdomain/technical-info/product/
http://forumdomain/technical-info/service/
http://forumdomain/other/

Is there any way to fix this?

underc0de

I'm using SMF 2.0.8 with Nginx, and this is my configuration:


user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {
        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # nginx-naxsi config
        ##
        # Uncomment it if you installed nginx-naxsi
        ##

        #include /etc/nginx/naxsi_core.rules;

        ##
        # nginx-passenger config
        ##
        # Uncomment it if you installed nginx-passenger
        ##
       
        #passenger_root /usr;
        #passenger_ruby /usr/bin/ruby;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;



       
server{
                listen 80;
                server_name  _;
                root   /usr/share/nginx/html;
                index  index.html index.htm;

location /
    {
            root /usr/share/nginx/html/xdadasda;
            index index.php index.html;
     
            if (!-e $request_filename)
            {
                    # Rules for: profiles
                    rewrite ^/xdadasda/profile/([^/]+)/?$ "/xdadasda/index.php?pretty;action=profile;user=$1" last;
         
                    # Rules for: actions
                    rewrite ^/xdadasda/(activate|admin|announce|attachapprove|buddy|calendar|clock|collapse)/?$ "/xdadasda/index.php?pretty;action=$1" last;
                    rewrite ^/xdadasda/(coppa|credits|deletemsg|display|dlattach|editpoll|editpoll2|emailuser)/?$ "/xdadasda/index.php?pretty;action=$1" last;
                    rewrite ^/xdadasda/(findmember|groups|help|helpadmin|im|jseditor|jsmodify|jsoption)/?$ "/xdadasda/index.php?pretty;action=$1" last;
                    rewrite ^/xdadasda/(lock|lockvoting|login|login2|logout|markasread|mergetopics|mlist)/?$ "/xdadasda/index.php?pretty;action=$1" last;
                    rewrite ^/xdadasda/(moderate|modifycat|modifykarma|movetopic|movetopic2|notify|notifyboard|openidreturn)/?$ "/xdadasda/index.php?pretty;action=$1" last;
                    rewrite ^/xdadasda/(pm|post|post2|printpage|profile|quotefast|quickmod|quickmod2)/?$ "./index.php?pretty;action=$1" last;
                    rewrite ^/xdadasda/(recent|register|register2|reminder|removepoll|removetopic2|reporttm|requestmembers)/?$ "/xdadasda/index.php?pretty;action=$1" last;
                    rewrite ^/xdadasda/(restoretopic|search|search2|sendtopic|smstats|suggest|spellcheck|splittopics)/?$ "/xdadasda/index.php?pretty;action=$1" last;
                    rewrite ^/xdadasda/(stats|sticky|theme|trackip|about:mozilla|about:unknown|unread|unreadreplies)/?$ "/xdadasda/index.php?pretty;action=$1" last;
                    rewrite ^/xdadasda/(verificationcode|viewprofile|vote|viewquery|viewsmfile|who|\.xml|xmlhttp)/?$ "/xdadasda/index.php?pretty;action=$1" last;
         
                    # Rules for: boards
                    rewrite ^/xdadasda/([-_!~*'()$a-zA-Z0-9]+)/?$ "/xdadasda/index.php?pretty;board=$1.0" last;
                    rewrite ^/xdadasda/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ "/xdadasda/index.php?pretty;board=$1.$2" last;
         
                    # Rules for: topics
                    rewrite ^/xdadasda/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ "/xdadasda/index.php?pretty;board=$1;topic=$2.0" last;
                    rewrite ^/xdadasda/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ "/xdadasda/index.php?pretty;board=$1;topic=$2.$3" last;
         
                    rewrite ^/xdadasda/(.*)$ "/xdadasda/index.php?params=$1" last;
            }
}
}

}


But when I try suft in the boards or topics, the forum displays 404.
Whats is the problem?

vbgamer45

Not sure. I have always had a tough time with rewrite rules for nginx
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

underc0de

Yes me too.. I need help with my configuration!!


Fisch.666

@underc0de

My rules are still working which i have converted as posted some years ago:


        location / {

                # Rules for: spages
                rewrite ^/forum/guestbook "/forum/index.php?spage=guestbook" last;
                rewrite ^/forum/shop "/forum/index.php?spage=shop" last;
                rewrite ^/forum/impressum "/forum/index.php?spage=impressum" last;
                rewrite ^/forum/artikel "/forum/index.php?spage=artikel" last;
                rewrite ^/forum/links "/forum/index.php?spage=links" last;

                # Rules for: smftags
                rewrite ^/forum/tags/([^/]+)/([0-9]*)/?$ "/forum/index.php?action=tags;tagid=$2" last;

                # Rules for: aeva
                rewrite ^/forum/media/(thumba?|preview)/([0-9]+)/?(.*)$ "/forum/index.php?action=media;sa=media;in=$2;$1;$3" last;
                rewrite ^/forum/media/(?:(album|item|media)/([0-9]+)/?)?(.*)$ "/forum/index.php?action=media;sa=$1;in=$2;$3" last;

                # Rules for: actions
                rewrite ^/forum/(activate|admin|announce|attachapprove|buddy|calendar|chat|clock)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(collapse|community|coppa|credits|deletemsg|display|dlattach|editpoll|editpoll2)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(emailuser|findmember|groups|help|helpadmin|im|jseditor|jsmodify)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(jsoption|lock|lockvoting|login|login2|logout|markasread|mergetopics)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(media|mgallery|mlist|moderate|modifycat|modifykarma|movetopic|movetopic2)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(notify|notifyboard|openidreturn|pm|post|post2|printpage|profile)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(quotefast|quickmod|quickmod2|recent|register|register2|reminder|removepoll)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(removetopic2|reporttm|requestmembers|restoretopic|search|search2|sendtopic|shoutbox)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(sitemap|smstats|suggest|spellcheck|splittopics|stats|sticky|tags)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(switchpermissions|thankyou|thankyouajax|thankyoupostlock|thankyoupostlist|thankyoupostdelete|thankyoupostdm|thankyoupostcloseall)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(thankyoupostunlockall|theme|trackip|about:mozilla|about:unknown|unread|unreadreplies|verificationcode)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(viewprofile|vote|viewquery|viewsmfile|who|\.xml|xmlhttp)/?$ "/forum/index.php?pretty;action=$1" last;

                # Rules for: boards
                rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/?$ "/forum/index.php?pretty;board=$1.0" last;
                rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ "/forum/index.php?pretty;board=$1.$2" last;

                # Rules for: topics
                rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ "/forum/index.php?pretty;board=$1;topic=$2.0" last;
                rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ "/forum/index.php?pretty;board=$1;topic=$2.$3" last;

                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

Tunicman

Hello, when i change my Topic's title, url does not change. How can i fix this, so when i change title, my url would change also.

I can change url for boards, but not for topics. Help me!

Thanks you

vbgamer45

At the moment it you have to go inside the database and change. This is done for SEO reasons otherwise you would loose your rankings any time you changed the title.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

underc0de

Quote from: Fisch.666 on August 19, 2014, 07:39:14 AM
@underc0de

My rules are still working which i have converted as posted some years ago:


        location / {

                # Rules for: spages
                rewrite ^/forum/guestbook "/forum/index.php?spage=guestbook" last;
                rewrite ^/forum/shop "/forum/index.php?spage=shop" last;
                rewrite ^/forum/impressum "/forum/index.php?spage=impressum" last;
                rewrite ^/forum/artikel "/forum/index.php?spage=artikel" last;
                rewrite ^/forum/links "/forum/index.php?spage=links" last;

                # Rules for: smftags
                rewrite ^/forum/tags/([^/]+)/([0-9]*)/?$ "/forum/index.php?action=tags;tagid=$2" last;

                # Rules for: aeva
                rewrite ^/forum/media/(thumba?|preview)/([0-9]+)/?(.*)$ "/forum/index.php?action=media;sa=media;in=$2;$1;$3" last;
                rewrite ^/forum/media/(?:(album|item|media)/([0-9]+)/?)?(.*)$ "/forum/index.php?action=media;sa=$1;in=$2;$3" last;

                # Rules for: actions
                rewrite ^/forum/(activate|admin|announce|attachapprove|buddy|calendar|chat|clock)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(collapse|community|coppa|credits|deletemsg|display|dlattach|editpoll|editpoll2)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(emailuser|findmember|groups|help|helpadmin|im|jseditor|jsmodify)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(jsoption|lock|lockvoting|login|login2|logout|markasread|mergetopics)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(media|mgallery|mlist|moderate|modifycat|modifykarma|movetopic|movetopic2)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(notify|notifyboard|openidreturn|pm|post|post2|printpage|profile)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(quotefast|quickmod|quickmod2|recent|register|register2|reminder|removepoll)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(removetopic2|reporttm|requestmembers|restoretopic|search|search2|sendtopic|shoutbox)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(sitemap|smstats|suggest|spellcheck|splittopics|stats|sticky|tags)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(switchpermissions|thankyou|thankyouajax|thankyoupostlock|thankyoupostlist|thankyoupostdelete|thankyoupostdm|thankyoupostcloseall)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(thankyoupostunlockall|theme|trackip|about:mozilla|about:unknown|unread|unreadreplies|verificationcode)/?$ "/forum/index.php?pretty;action=$1" last;
                rewrite ^/forum/(viewprofile|vote|viewquery|viewsmfile|who|\.xml|xmlhttp)/?$ "/forum/index.php?pretty;action=$1" last;

                # Rules for: boards
                rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/?$ "/forum/index.php?pretty;board=$1.0" last;
                rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ "/forum/index.php?pretty;board=$1.$2" last;

                # Rules for: topics
                rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ "/forum/index.php?pretty;board=$1;topic=$2.0" last;
                rewrite ^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ "/forum/index.php?pretty;board=$1;topic=$2.$3" last;

                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }


Thanks! I modify with my paths, but nothing.. I have the same problem..

More solutions?

Regards

SilverKnight

This mod needs to support split forum mod.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Masterd

Quote from: SilverKnight on August 23, 2014, 03:57:15 AM
This mod needs to support split forum mod.

The author has to decide on that.

Fisch.666

@underc0de

This is the only solution i can provide. Works here on several SMF 2.0.8 boards running on NginX 1.6.x.

If you still can't get PrettyURLs to work with this you probably made the wrong edits or have some wired non-standard NginX configs running which interferences with the rewrite rules above.

dougiefresh

Quote from: SilverKnight on August 23, 2014, 03:57:15 AM
This mod needs to support split forum mod.
I'm gonna see what I can do about compatibility between the two.  (I'm the author of Split Forum Mod)

vbgamer45

Quote from: dougiefresh on August 25, 2014, 06:23:02 AM
Quote from: SilverKnight on August 23, 2014, 03:57:15 AM
This mod needs to support split forum mod.
I'm gonna see what I can do about compatibility between the two.  (I'm the author of Split Forum Mod)
That would be awesome thanks
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

ikeveles

My board is in Cyrillic characetrs, so for example the first topic when creating your SMF "Добредојдовте на SMF форумот!." is transformed from

/index.php?topic=1.0 to /ota-ka/oeoote-a-smf-omot!/


It's the same with Russian, Bulgarian and some other languages too. What to do now?

Advertisement: