News:

Wondering if this will always be free?  See why free is better.

Main Menu

Pretty URLs

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

Previous topic - Next topic

Kindred

Quote from: DeveloperMcD on June 28, 2023, 12:16:15 PM
Quote from: vbgamer45 on June 28, 2023, 12:11:49 PMThe issue is the space. what SMF version?

2.0.14

well, you definitely need to upgrade to at least 2.0.19 ASAP
Сл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."

vbgamer45

Update

 Pretty URLs 3.0                                              29  June 2023
    ================================================================================ 
  !Fixes for handling spaces in profile urls. SMF 2.1.x SMF 2.0.x
  !Use display name instead of username for profile urls  SMF 2.1.x, SMF 2.0.x, SMF 1.1.x
  !Use caching instead of sql queries by default for url replacements
Community Suite for SMF - Grow your forum with 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

agagames

I've noticed a tiny bug where posts belonging to a deleted user will throw a missing array key error.  I've managed to fix it by changing line 578 in PrettyUrls-Filters.php to:

if ((isset($url['profile_id'])) && (isset($memberNames[$url['profile_id']])))

vbgamer45

Thanks added the fix!
Community Suite for SMF - Grow your forum with 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

agagames

And another one, Display.php, line 44:

if ((isset($context['pretty']['oldschoolquery']) || (isset($context['pretty']['query_string']['board']) && ($context['pretty']['query_string']['board'] != $context['pretty']['board_urls'][$board]))) && $modSettings['pretty_enable_filters'])

vbgamer45

Thanks @agagames have added the fix!
Community Suite for SMF - Grow your forum with 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

Butiks

Dear SMFHacks.com Team,

Does your mod allow you to customize links like this?
forum.com/user1.html
forum.com/board5.20.html
forum.com/topic12345.40.html

If there is no such possibility now, maybe you are considering adding such a setting additionally in the future?
SMF: 2.1.3
Mods: Optimus, Hide Content, Quick Spoiler, Avatars Display Integration, Similar Topics, Simple Colorizer

Diego Andrés

I think you can enable that in vanilla SMF.
Configuration > Features and Options > General > Search engine friendly URLs

SMF Tricks - Free & Premium Responsive Themes for SMF.

Butiks

#8268
Quote from: Diego Andrés on July 09, 2023, 05:44:19 PMI think you can enable that in vanilla SMF.
Configuration > Features and Options > General > Search engine friendly URLs
Thank you)
How to delete `index.php` from url?
forum.com/index.php/topic,1.0.html
need to
forum.com/topic,1.0.html

Update post:

Souirces/QueryString.php
`/index.php` to `/`
SMF: 2.1.3
Mods: Optimus, Hide Content, Quick Spoiler, Avatars Display Integration, Similar Topics, Simple Colorizer

Kindred

Quote from: Butiks on July 09, 2023, 06:45:42 PM
Quote from: Diego Andrés on July 09, 2023, 05:44:19 PMI think you can enable that in vanilla SMF.
Configuration > Features and Options > General > Search engine friendly URLs
Thank you)
How to delete `index.php` from url?
forum.com/index.php/topic,1.0.html
need to
forum.com/topic,1.0.html

Update post:

Souirces/QueryString.php
`/index.php` to `/`


NO!!  DO NOT DO THAT!!
 
You should not remove the index.php -- definitely not like that

and there is also a question as to why you want .html urls....     You do realize that it literally has NO impact on search engines any more (not for the last 5-10 years)
Сл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."

Butiks

Quote from: Kindred on July 09, 2023, 07:21:43 PM
Quote from: Butiks on July 09, 2023, 06:45:42 PM
Quote from: Diego Andrés on July 09, 2023, 05:44:19 PMI think you can enable that in vanilla SMF.
Configuration > Features and Options > General > Search engine friendly URLs
Thank you)
How to delete `index.php` from url?
forum.com/index.php/topic,1.0.html
need to
forum.com/topic,1.0.html

Update post:

Souirces/QueryString.php
`/index.php` to `/`


NO!!  DO NOT DO THAT!!
 
You should not remove the index.php -- definitely not like that

and there is also a question as to why you want .html urls....     You do realize that it literally has NO impact on search engines any more (not for the last 5-10 years)
Sorry.  ???
And what's wrong with removing the "unnecessary part" of the link, without which all links on the forum work correctly?
SMF: 2.1.3
Mods: Optimus, Hide Content, Quick Spoiler, Avatars Display Integration, Similar Topics, Simple Colorizer

Kindred

It's not unnecessary and, unless things have changed, some parts of the forum will not work with what you have done

Сл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."

vbgamer45

Version 4.0
+Added an area to generate/view Nginx rules if you are using the Nginx webserver.
Community Suite for SMF - Grow your forum with 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

Aaron10

Getting an error visiting the admin area

Sources/PrettyUrls.php (Line 35)

2: Undefined array key "pretty_chrome_menu_nginix"

Otherwise all good. Is it better to use caching or database tables for Pretty URLs (ticked or unticked)? I know this has probably been asked a bunch of times, thanks.

vbgamer45

Caching normally better.
For the error what SMF version?
Community Suite for SMF - Grow your forum with 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

Aaron10

Alright thanks :)

2.1.4, other mods:

Simple Colorizer
Optimus
EhPortal

The error is only confined to the Pretty URLs area in admin.

vbgamer45

Thanks posted a fix.
Community Suite for SMF - Grow your forum with 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

Hysst

I have a problem and it is that the user profile does not redirect correctly, the rest of the views do, but the user profile does not.

In addition, whenever I start the server again I get an error log:

/Sources/PrettyUrls.php (Línea 340)
2: Undefined array key "nginx"
I leave here my vhost configuration in nginx in case someone can help me or detect some kind of error:

# Rules for: profiles
    rewrite ^profile/([^/]+)/?$ "/index.php?pretty;action=profile;user=$1" last;

    # Rules for: actions
    rewrite ^/(activate|admin|announce|attachapprove|badbehavior|buddy|buddies|calendar)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(clock|collapse|coppa|credits|deletemsg|display|dlattach|editpoll)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(editpoll2|refferals|emailuser|findmember|glossary|groups|guest|help)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(helpadmin|httpBL|ignoretopic|im|jseditor|jsmodify|jsoption|lock)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(lockvoting|login|login2|logout|markasread|mergetopics|mlist|moderate)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(modifycat|modifykarma|movetopic|movetopic2|notify|notifyboard|openidreturn|pm)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(post|post2|printpage|profile|quotefast|quickmod|quickmod2|rate)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(recent|register|register2|reminder|removepoll|removetopic2|reporttm|requestmembers)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(restoretopic|rules|search|search2|sendtopic|smstats|suggest|spellcheck)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(splittopics|stats|sticky|staff|theme|trackip|about:mozilla|about:unknown)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(unignoretopic|unread|unreadreplies|verificationcode|viewprofile|vote|viewquery|viewsmfile)/?$ "/index.php?pretty;action=$1" last;
    rewrite ^/(who|\.xml|xmlhttp)/?$ "/index.php?pretty;action=$1" last;

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

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

I have added these rules inside location / {
If I did it somewhere else I would get a configuration error.

Does anyone know how I can fix this?

vbgamer45

Try to change
 rewrite ^profile/([^/]+)/?$ "/index.php?pretty;action=profile;user=$1" last;

To
 rewrite ^/profile/([^/]+)/?$ "/index.php?pretty;action=profile;user=$1" last;
Community Suite for SMF - Grow your forum with 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

vicente127

#8279
Hello everyone!

I'm getting this error in the log hub
Quote2: Undefined array key "pretty_urls"
Error Type: Undefined_vars
URL Error: /forum/index.php?pretty;action=admin&area=manageboards

UPDATE: I ran the maintenance task and now I got  "2: Undefined array key "nginx"
URL: /forum/index.php?action=admin;area=pretty;sa=nginx;ca13a1578a64=1932bc28b4f204b6baa4f116de0a9dd8

Advertisement: