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

SomeoneElse

It knows that it's still 2.5.1c even if I change the filename, and still says no, but presumably it works for someone as that internally.

SomeoneElse

.. and if I edit the XML file to say that it's 2.5.1, it still has a red 'older version' mark and won't let me install it.

gorbi


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

Butiks

Hello.
Thanks for the wonderful mod. Everything works fine on SMF v2.1.3
I'm switching from the old version of the IPB (to SMF). And it is very important save that the old links work.
Search engines have remembered the old link format.

Please tell me how to change the output of information about links, changing the standard view, now it looks like this:

URLs FOR Boards
https://site.com/there-nameboard-sample/
 https://site.com/there-nameboard-sample/15/
 need to
 https://site.com/board233445.html
 https://site.com/board233445s15.html

URLs FOR Topics

https://site.com/there-nameboard-sample/there-name-topic-of-title/
 https://site.com/there-nameboard-sample/there-name-topic-of-title/15/
 need to
 https://site.com/topic233445.html
 https://site.com/topic233445s15.html

Use:
SMF v2.1.3
Pretty URLs v2.5.1c
Shared hosting with PHP v7.4

vbgamer45

That would be somewhat difficult. You would need access to the original database to to do a lookup based on the url entered.  Then do the mapping to the new url.

Pretty urls default is https://site.com/board-name/topic-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

Butiks

Quote from: vbgamer45 on March 09, 2023, 09:24:28 PMThat would be somewhat difficult. You would need access to the original database to to do a lookup based on the url entered.  Then do the mapping to the new url.

Pretty urls default is https://site.com/board-name/topic-title
After the forum conversion, all forum and topic IDs remained original. In which mod file can the code be corrected so that it displays links so that instead of names there are only ids?

vbgamer45

In that case would need pretty urls if want to display numbers? Do you want to keep urls like this site here?
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

Gryzor

#8248
Hello!

In a fresh installation (2.1.3), I'm trying to install the latest version (2.5.1c). However I'm getting the following errors when trying to apply the mod:

1.Execute ModificationSMF2-1/Sources.xmlFile not found
2.Execute ModificationSMF2-1/BoardsAndTopics.xmlFile not found
3.Execute ModificationSMF2-1/Themes.xmlFile not found
*4.Execute Modification./Themes/default/languages/Modifications.english.phpTest successful
5.Extract File./Sources/PrettyUrls.phpFile not found
6.Extract File./Sources/PrettyUrls-Filters.phpFile not found
7.Extract File./Sources/PrettyUrls-Tests.php
8.Extract File./Sources/Subs-PrettyUrls.phpFile not found
9.Extract File./Sources/Subs-PrettyUrls-Hooks.phpFile not found
10.Extract File./Themes/default/PrettyUrls.template.phpFile not found
11.Extract File./Themes/default/images/admin/prettyurls.png
12.Extract Tree./Themes/default/prettyFile not found
13.Extract File./Themes/default/languages/PrettyUrls.english.php
14.Add HookAdapting hook integrate_admin_areasTest successful
15.Adapt DatabaseSMF2-1/install.phpFile not found

I thought maybe it was a permissions issue but even setting the whole Packages directory to 777 temporarily doesn't solve it... any ideas?

Thanks!

So it would appear the package was not able to be extracted correctly; the root zip contents were extracted in temp/ , however the subfolders were not. Once I unzipped it manually I was able to install the mod, but still the usual SMF URLs appear, not prettified. No errors in the log, and htaccess has indeed been changed with:

# PRETTYURLS MOD BEGINS
# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: March 14, 2023, 11:44

RewriteEngine on
RewriteBase /forum

# Rules for: profiles
RewriteRule ^profile/([^/]+)/?$ ./index.php?pretty;action=profile;user=$1 [L,QSA]

# Rules for: actions
RewriteRule ^(agreement|acceptagreement|activate|admin|announce|attachapprove|buddy|calendar)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(clock|coppa|credits|deletemsg|dlattach|editpoll|editpoll2|findmember)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(groups|help|helpadmin|jsmodify|jsoption|likes|lock|lockvoting)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(login|login2|logintfa|logout|markasread|mergetopics|mlist|moderate)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(modifycat|movetopic|movetopic2|notifyannouncements|notifyboard|notifytopic|pm|post)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(post2|printpage|profile|quotefast|quickmod|quickmod2|recent|reminder)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(removepoll|removetopic2|reporttm|requestmembers|restoretopic|search|search2|sendactivation)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(signup|signup2|smstats|suggest|splittopics|stats|sticky|theme)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(trackip|about:unknown|unread|unreadreplies|uploadAttach|verificationcode|viewprofile|vote)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(viewquery|viewsmfile|who|\.xml|xmlhttp|forum)/?$ ./index.php?pretty;action=$1 [L,QSA]

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

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

# PRETTYURLS MOD ENDS

I'm puzzled...

Ok some more info, after changing it to use caching instead just to check things I got errors in the log:

In Subs-PrettyURLs.php:
In line 301: 2: Invalid argument supplied for foreach()
In line 298: 2: array_chunk() expects parameter 1 to be array, string given
In line 297: 8: Undefined index: action_array

Anybody can give any insights?

Thanks!

thatjustit

Hi, I have a small issue that I wrote about in this thread: https://www.simplemachines.org/community/index.php?topic=585227.0
Basically when "Enable URL rewriting" is enabled on SMF 2.1 then external links without bbcode turn into burning-brushes.pl///link.com and when I disable it then it's fine, but maybe I can add something to "Skip Actions List" so it doesn't happen?

DiscussAI.net


Chyandour

Hi,
Please see this topic about Pretty URLs and NotifyBoardReply mods not working well together. Any possible remedy you can think of would be appreciated.

https://www.simplemachines.org/community/index.php?topic=586148.0

agagames

I have rewrite rules on my main site, as well as using Pretty URLs in /forums/.  However, this seems to cause issues, as I frequently see the following in the error log:

 /MY_SMF_FOLDER/Sources/PrettyUrls-Filters.php (Line 93)
No direct access...

SELECT url_id, replacement
FROM `ags_forums`.smf_pretty_urls_cache
WHERE url_id IN ('/images/favicon.ico', '/includes/index.css', '/includes/trumbowyg/ui/trumbowyg.css', '/site/cookies/', '/', '/site/community/donate/', '/forums/index.php?action=login', '/forums/', '/site/ags/', '/site/games/', '/site/community/', '/includes/gamesrss.xml', '/site/games/game/2675-les-chroniques-de-katura-partie-2-cha-lle/', '/site/games/game/2674-les-chroniques-de-katura-partie-1-la-l-gende-d-eikos/', '/site/games/game/2673-the-sleeping-castle/', '/site/games/game/2672-stygiophobia-another-day/', '/site/games/game/2671-elevation/', '/site/games/search/', '/site/games/awards/', '/site/games/picks/', 'site/games/search/game_lengths:1,6,0,2,3,7,4,5,15;genres:1,2,3,4,5,0;game_types:1,2,3,4,5,0;story_types:3;commercial:1/1/name/asc/', [...], '/forums/index.php?action=profile;u=988', '/forums/index.php?action=profile;u=817', '/forums/index.php?action=profile;u=39')
Function: pretty_rewrite_buffer

Basically it seems to be including URLs from outside /forums/ in its rewrites, and getting confused?

If it's any help, my root .htaccess is:
AddDefaultCharset utf-8
AddCharset utf-8 .php

SetEnv TZ Europe/London

ErrorDocument 404 /site/404/

RewriteEngine On
RewriteCond %{HTTPS} off
# First rewrite to HTTPS.  Don't put www. here.  If it is already there it will be included, if not the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.  [NC] is a case-insensitive match.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule ^(forums)($|/) - [L]
RewriteRule ^site/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)(/)?$ /index.php?a=$1&b=$2&c=$3&d=$4&e=$5&f=$6&g=$7 [L]
RewriteRule ^site/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)(/)?$ /index.php?a=$1&b=$2&c=$3&d=$4&e=$5&f=$6 [L]
RewriteRule ^site/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)(/)?$ /index.php?a=$1&b=$2&c=$3&d=$4&e=$5 [L]
RewriteRule ^site/([^/]*)/([^/]*)/([^/]*)/([^/]*)(/)?$ /index.php?a=$1&b=$2&c=$3&d=$4 [L]
RewriteRule ^site/([^/]*)/([^/]*)/([^/]*)(/)?$ /index.php?a=$1&b=$2&c=$3 [L]
RewriteRule ^site/([^/]*)/([^/]*)(/)?$ /index.php?a=$1&b=$2 [L]
RewriteRule ^site/([^/]*)(/)?$ /index.php?a=$1 [L]

#RewriteRule ^meets/([^/]*)/([^/]*)/([^/]*)/([^/]*)(/)?$ /meets/index.php?s=$1&y=$2&e=$3&i=$4 [L]

RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]

# Rewrite old forums URLs to new
RedirectMatch 301 /yabb/*.* /forums/$1
Redirect 301 /games.php /site/games/
Redirect 301 /forumauth.php /
Redirect 301 /wp-login.php /
Redirect 301 /forums/wp-login.php /
Redirect 301 /kbview.php /
Redirect 301 /xmlrpc.php /
Redirect 301 /gamesrss.php /includes/gamesrss.xml

# Redirect /manual to GitHub manual
Redirect 301 /manual ANOTHER_SITE

RewriteBase /

And /forums/ one:
# PRETTYURLS MOD BEGINS
# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: June 11, 2023, 8:57

RewriteEngine on
RewriteBase /forums

# Rules for: profiles
RewriteRule ^profile/([^/]+)/?$ ./index.php?pretty;action=profile;user=$1 [L,QSA]

# Rules for: actions
RewriteRule ^(agreement|acceptagreement|activate|admin|announce|attachapprove|buddy|calendar)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(clock|coppa|credits|deletemsg|dlattach|editpoll|editpoll2|findmember)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(groups|help|helpadmin|jsmodify|jsoption|likes|lock|lockvoting)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(login|login2|logintfa|logout|markasread|mergetopics|mlist|moderate)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(modifycat|movetopic|movetopic2|notifyannouncements|notifyboard|notifytopic|pm|post)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(post2|printpage|profile|quotefast|quickmod|quickmod2|recent|reminder)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(removepoll|removetopic2|reporttm|requestmembers|restoretopic|search|search2|sendactivation)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(signup|signup2|smstats|suggest|splittopics|staff|stats|sticky)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(theme|trackip|about:unknown|unread|unreadreplies|uploadAttach|verificationcode|viewprofile)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(vote|viewquery|viewsmfile|who|\.xml|xmlhttp|forum|unsetedittime)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(faq|googlemap|\.kml)/?$ ./index.php?pretty;action=$1 [L,QSA]

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

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

# PRETTYURLS MOD ENDS

vbgamer45

The full error message is "No direct access..." with that sql query? nothing else?
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

agagames

Quote from: vbgamer45 on June 24, 2023, 10:10:28 AMThe full error message is "No direct access..." with that sql query? nothing else?

Sorry, forgot to include the context:

QuoteGuest
a=games&b=notveryrated&c=
/MY_SMF_FOLDER/Sources/PrettyUrls-Filters.php (Line 93)

Which suggests a main site URL is being accessed on the forums?  But yeah, above is the full text of the error, only with 99% of the massive SQL query cut out to avoid hitting the post length limit.

vbgamer45

There should be an option to turn off queries under settings i forget the name of it under petty urls use buffer instead of queries or something
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

agagames

Quote from: vbgamer45 on June 26, 2023, 11:41:48 AMThere should be an option to turn off queries under settings i forget the name of it under petty urls use buffer instead of queries or something

"Use caching instead of database table for PrettyUrls".  I'll give that a try, thanks!

DeveloperMcD

For a while now, Pretty URLs has been choking on any username that has a space character in it.

https://www.domain.com/profile/Ronald%20McDonald/ [nofollow]
or
https://www.domain.com/profile/Ronald [nofollow] McDonald/

The fix right now is to MANUALLY change the URL to:
https://www.domain.com/profile/Ronald+McDonald/ [nofollow]

I don't think this was ALWAYS an issue; but it certainly is now. How to fix it?

vbgamer45

The issue is the space. what SMF version?
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

DeveloperMcD


Advertisement: