Pretty URLs

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

Previous topic - Next topic

vbgamer45

I guess what is the issue? Not understanding.
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

Diego Andrés

Looks like he used a translation tool, he means that all the URLs redirect to the index.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Xpresskonami

Please what could be the cause of this?

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 11347033 bytes) in /home3/spyloade/public_html/Sources/PrettyUrls-Filters.php on line 132

This happened whenever I go to schedule task to run the sitemap.

vbgamer45

Sitemap is that from pretty urls pro? what is the is exact task name
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

radge

Quote from: vbgamer45 on January 08, 2024, 10:47:29 AMI guess what is the issue? Not understanding.

Yes, all the URLs redirect to the index with SMF 2.1.4
I'm using nginx 1.18
Nuevo foro sobre renault http://www.renaultforo.com

vbgamer45

Hmm check this topic for other examples. i used the rules that other people said worked for them in the past.
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

Sono

I am trying to uninstall Pretty URLS 1.1.1a. My forum version is 2.0.9. When I click uninstall, the test runs, but returns an error at 1 position:

It is looking for:
/***    if (empty($modSettings['queryless_urls']) || ($context['server']['is_cgi'] && @ini_get('cgi.fix_pathinfo') == 0 && @get_cfg_var('cgi.fix_pathinfo') == 0) || (!$context['server']['is_apache'] && !$context['server']['is_lighttpd']))
        return $val;

    $val = preg_replace('/^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+)(#[^"]*)?$/e', '\'\' . $scripturl . \'/\' . strtr(\'$1\', \'&;=\', \'//,\') . \'.html$2\'', $val); ***/

And want to replace it to:

if (empty($modSettings['queryless_urls']) || ($context['server']['is_cgi'] && @ini_get('cgi.fix_pathinfo') == 0 && @get_cfg_var('cgi.fix_pathinfo') == 0) || (!$context['server']['is_apache'] && !$context['server']['is_lighttpd']))
return $val;

$val = preg_replace('/^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+)(#[^"]*)?$/e', '\'\' . $scripturl . \'/\' . strtr(\'$1\', \'&;=\', \'//,\') . \'.html$2\'', $val);

But, what I have there is:

/***    if (empty($modSettings['queryless_urls']) || ($context['server']['is_cgi'] && @ini_get('cgi.fix_pathinfo') == 0 && @get_cfg_var('cgi.fix_pathinfo') == 0) || (!$context['server']['is_apache'] && !$context['server']['is_lighttpd']))
        return $val;

    $val = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+)(#[^"]*)?$~', create_function('$m', 'global $scripturl; return $scripturl . \'/\' . strtr("$m[1]", \'&;=\', \'//,\') . \'.html\' . (isset($m[2]) ? $m[2] : "");'), $val); ***/

What shall I do? Replace it to what the uninstaller wants or leave the one in News.php only deleting the comment marks what the uninstall script actually wants? You see the second half of the code concerned differs. Don't know why. As I see normally it is only a comment mark deletion I guess, I don't have a clue why my code changed over time.

vbgamer45

The create_function is old code.
TO revert completely I would reverse the old package for uninstall instructions

Also you should upgrade to SMF 2.0.19 asap.
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

Sono

Quote from: vbgamer45 on January 18, 2024, 01:23:48 AMThe create_function is old code.
TO revert completely I would reverse the old package for uninstall instructions

Also you should upgrade to SMF 2.0.19 asap.

What do you mean by reversing the old package for uninstall instructions? 1. Leave the code as is in News.php and remove the /** **/ or 2. paste back the code the uninstaller wants to revert to manually?

vbgamer45

Well you could replace with the original SMF code probably be easier and just skip that step on uninstall.
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

Kindred

Or,just do a direct upgrade to 2.0.19 which will reset all mod edits and then reinstall current versions of the mods
Сл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."

Sono

Quote from: Kindred on January 18, 2024, 09:20:12 AMOr,just do a direct upgrade to 2.0.19 which will reset all mod edits and then reinstall current versions of the mods

That might be problematic due to the extensive use on my site of SimplePortal. Loosing its added panels with lots of code in them will be a big problem.

Sono

Well, I figured out a Cutting the Gordian Knot type of solution. I added Pretty URLs back in the days because I was told Google won't index the dynamic pages. Since then it turned out my forum is getting traffic organically, maybe 1% of it comes from Google. So no need to worry about indexing problems any more. I can just go on with Pretty URLs uninstalled.

I removed the /*** marks from the problematic part in News.php. Apart from that the test reported everything should uninstall properly. The mod removed, forum seems to work fine. Anything to do to make sure there won't be error? Removing something from the database or htaccess?

Xpresskonami

Quote from: vbgamer45 on January 15, 2024, 07:18:37 AMSitemap is that from pretty urls pro? what is the is exact task name

Sitemap XML Generation

Xpresskonami

Quote from: vbgamer45 on January 15, 2024, 07:18:37 AMSitemap is that from pretty urls pro? what is the is exact task name

Not from Pretty Url Pro. From Optimus Brave Mod

vbgamer45

Probably getting caught in a loop or too many urls? How big is the sitemap?
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

Sono

I have removed Pretty URLs some days ago, but I noticed this piece of code in News.php. I wonder if this is okay that it is still there or if I should remove it manually?

// Pretty URLs need to be rewritten
ob_start('ob_sessrewrite');
$context['pretty']['search_patterns'][] = '~(<link>|<id>|<comments>|<guid>)([^#<]+)~';
$context['pretty']['replace_patterns'][] = '~(<link>|<id>|<comments>|<guid>)([^<]+)~';

if ($xml_format == 'smf' || isset($_REQUEST['debug']))
header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
elseif ($xml_format == 'rss' || $xml_format == 'rss2' || $xml_format == 'webslice')
header('Content-Type: application/rss+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
elseif ($xml_format == 'atom')
header('Content-Type: application/atom+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
elseif ($xml_format == 'rdf')
header('Content-Type: ' . ($context['browser']['is_ie'] ? 'text/xml' : 'application/rdf+xml') . '; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));

Xpresskonami

Quote from: vbgamer45 on January 20, 2024, 11:32:20 AMProbably getting caught in a loop or too many urls? How big is the sitemap?

About 20,000+ links

Sono

I have uninstalled Pretty URLS, but I noticed a lot of stuff from it is still present. This code is still in my .htaccess file. Is this normal?

# PRETTYURLS MOD BEGINS
# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: January 15, 2024, 23:12

RewriteEngine on
RewriteBase /

# Rules for: actions
RewriteRule ^(activate|admin|announce|attachapprove|buddy|calendar|clock|collapse)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(coppa|credits|deletemsg|display|dlattach|editpoll|editpoll2|emailuser)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(findmember|forum|portal|groups|help|helpadmin|hidetopic|im)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(jseditor|jsmodify|jsoption|lock|lockvoting|login|login2|logout)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(markasread|mergetopics|mlist|moderate|modifycat|modifykarma|movetopic|movetopic2)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(notify|notifyboard|openidreturn|pm|post|post2|printpage|profile)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(quotefast|quickmod|quickmod2|recent|register|register2|reminder|removepoll)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(removetopic2|reporttm|requestmembers|restoretopic|search|search2|sendtopic|smstats)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(suggest|spellcheck|splittopics|stats|sticky|theme|trackip|about:mozilla)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(about:unknown|unread|unreadreplies|verificationcode|viewprofile|vote|viewquery|viewsmfile)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(who|\.xml|xmlhttp)/?$ ./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

This should have been removed by the uninstaller, shouldn't it?

Gryzor

Hello!

I'm (still) on 2.5.1c. Are there any special steps I should follow to upgrade to v4?

Thanks!

Advertisement: