Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 181
Total: 181

Author Topic: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads  (Read 9777 times)

0 Members and 1 Guest are viewing this topic.

Offline drewactual

  • Member
  • *
  • Posts: 43
    • View Profile
Will installing Pretty URL's break links? or, are users still able to reach threads/posts by using the SMF calls even with Pretty URL's installed? 

How much does the function slow a site?


Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #1 on: April 01, 2019, 10:53:30 am »
Doesn't break existing links. They will redirect to the original topic/location. For my forums I generally just do rewriting of boards, topics/posts and do not do action rewriting.

It terms of speed it depends on the options selected. You can use the other cache that uses no database calls which makes it quicker for processing its in the pretty urls main settings.

I use the same system on createaforum.com and I have probably 40k forums on one server. Another example site of mine https://www.ezportal.com
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline drewactual

  • Member
  • *
  • Posts: 43
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #2 on: April 01, 2019, 11:08:16 am »
last weekend i (re)installed mod_pagespeed.   I was loading DOM in well under a second even prior, but pursued the function anyway for the re-writing of images (webp) and lazyloading- as well as collecting and minifying css and js which has about got out of control (i have a main combined and minified js and css which are both sizable and which are h2 pushed to the client PRIOR to the mod_pagespeed re-install)... now the page is about the same speed as it was, but should be more reliant on client cache and optimized output (via pagespeed). 

question:  do you have any sites using mod_pagespeed and pretty url's?  Do they play nicely?  I have SMF's cache at level 2 and the server side zlib turned off, and use memcached... i also use opcache... these don't have any strange conflicts- another of my concerns is pretty url's (and I'm not just about pretty URL's, i'd like to re-purchase the entire SEO suite) will encounter a conflict with mod_pagespeed. 

(contos7;apache2.4 and MPM worker FPM/FastCGI, php7.1; a dedicated server so i can add or remove whatever mod_'s i need to)

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #3 on: April 01, 2019, 11:28:54 am »
I don't use mod_pagespeed on my sites. I use apache 2.4 latest smf level 3 cache, I think zlib is off as well. And I use memcached  too

Shouldn't be any conflicts with that module.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline drewactual

  • Member
  • *
  • Posts: 43
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #4 on: April 01, 2019, 07:53:18 pm »
well, i dumped pagespeed- it was too feeble without over complicating it. 

so this is POST purchase question:  when i install this thing, will it overwrite the existing htaccess?  it's fairly bloated as it is, and to the point i was considering moving it to the httpd.conf instead.....

many thanks, sir. 

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #5 on: April 01, 2019, 07:57:49 pm »
Make a backup just in case. Hopefully it shouldn't though.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline drewactual

  • Member
  • *
  • Posts: 43
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #6 on: April 02, 2019, 07:30:26 pm »
sweet baby james!!! where in the hades is the function for listing Pretty Url's in the Admin menu under configuration?

I'm making certain the older version i have is completely removed before installing the one I just purchased, and i can't find this!!! :)  I've been through every line in the install xml's, and i can't locate this.  everything else is gone........... i hope.

edited: found it.  Admin.php somewhere around line 515
« Last Edit: April 02, 2019, 08:16:50 pm by drewactual »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #7 on: April 02, 2019, 08:42:34 pm »
Is it appearing now?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline drewactual

  • Member
  • *
  • Posts: 43
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #8 on: April 02, 2019, 10:45:51 pm »
nope... i got it.  i was looking right past it every SINGLE time...

i've cleared all the files so that the installer will work.  man, that old version i had was buried in like a tic.  for whatever reason my site is exceptionally busy for late on a tuesday eve, but as soon as it clears a bit i'm installing...

in the meantime:

Q: i realize now the pages can still be found using the SMF inherit link structure, but.... will the 'new' pages (with pretty URLs) append as 'new' pages on search indexes?  I'm guessing a sitemap may grant me a 'get out of jail free' card if it does, but i'm thinking it'll be better if it doesn't....

Offline drewactual

  • Member
  • *
  • Posts: 43
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #9 on: April 03, 2019, 07:33:52 am »
it's up and running, and doing a great job!!!!

just if anyone else happens along to see this, here are a few things:

- my instance of SMF2.0.15 is highly customized, and i make liberal use of includes into various places.  for whatever reason the include files were okay, but the images within were NOT.... so.... i had to go through them and give a full path to the images (not .././image, but https://image) ... i also had to do the same thing with js and css.  not a big deal- all the time i've spent organizing the site came in handy at this point, and paid off.  in an 'out of the box' instance it should be even easier.

- i found the cache option for pretty url's not a little slower than the db but a LOT.  i reckon YMMV, so- play with it. 

- i WAS on SMF cache level2 with memcached, and i also run OPCache.  with PrettyURL's running atop that, the site's benchmark dropped from an average DOM load of .8seconds to a touch over 3 seconds.  I bumped up to level3 cache and i'm back in the sub-second class again.

AWESOME MOD!!!! many thanks, Sir VBG.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #10 on: April 03, 2019, 10:54:23 am »
Thanks give this a shot too. I use this on creataeforum replace the function sources/prettyurls-filters.php
Code: [Select]
// Rewrite the buffer with Pretty URLs!
function pretty_rewrite_buffer($buffer)
{

global $boardurl, $context, $modSettings, $smcFunc;

// Remove the script tags now
$context['pretty']['scriptID'] = 0;
$context['pretty']['scripts'] = array();
$buffer = preg_replace_callback('~<script.+?</script>~s', 'pretty_scripts_remove', $buffer);

// Find all URLs in the buffer
$context['pretty']['search_patterns'][] = '~(<a[^>]+href=|<link[^>]+href=|<form[^>]+?action=)(\"[^\"#]+|\'[^\'#]+)~';
$urls_query = array();
$uncached_urls = array();

if (!isset($context['session_var']))
$context['session_var'] = '';

foreach ($context['pretty']['search_patterns'] as $pattern)
{
preg_match_all($pattern, $buffer, $matches, PREG_PATTERN_ORDER);
foreach ($matches[2] as $match)
{
// Rip out everything that shouldn't be cached
$match = preg_replace(array('~^[\"\']|PHPSESSID=[^;]+|(se)?sc=[^;]+|' . $context['session_var'] . '=[^;]+~', '~\"~', '~;+|=;~', '~\?;~', '~\?$|;$|=$~'), array('', '%22', ';', '?', ''), $match);

// Absolutise relative URLs
if (!preg_match('~^[a-zA-Z]+:|^#|@~', $match) && SMF != 'SSI')
$match = $boardurl . '/' . $match;

// Replace $boardurl with something a little shorter
$url_id = str_replace($boardurl, '`B', $match);

if (substr($url_id,0,7) == 'mailto:')
continue;
if (substr($url_id,0,10) == 'javascript')
continue;

if (substr($url_id,0,11) == 'android-app')
continue;

if (substr($url_id,0,20) == '`B/index.php?action=')
continue;



if ($url_id == '`B/index.php')
continue;


if (substr($url_id,0,7) == 'http://')
continue;

if (substr($url_id,0,8) == 'https://')
continue;

if (substr($url_id,0,18) == '`B/Themes/default/')
continue;

if (strrpos($url_id,'?wap2') !== false)
continue;

if (strrpos($url_id,'upgrades.php') !== false)
continue;
if (strrpos($url_id,'action=') !== false)
continue;

$urls_query[] = $url_id;
$uncached_urls[$url_id] = array(
'url' => $match,
'url_id' => $url_id
);
}
}


// Procede only if there are actually URLs in the page
if (count($urls_query) != 0)
{
$urls_query = array_keys(array_flip($urls_query));
// Retrieve cached URLs
$context['pretty']['cached_urls'] = array();


// If there are any uncached URLs, process them
if (count($uncached_urls) != 0)
{
// Run each filter callback function on each URL
$filter_callbacks = unserialize($modSettings['pretty_filter_callbacks']);
foreach ($filter_callbacks as $callback)
$uncached_urls = call_user_func($callback, $uncached_urls);

// Fill the cached URLs array
// $cache_data = array();
foreach ($uncached_urls as $url_id => $url)
{
if (!isset($url['replacement']))
$url['replacement'] = $url['url'];
$url['replacement'] = str_replace("\x12", '\'', $url['replacement']);
$url['replacement'] = preg_replace(array('~\"~', '~;+|=;~', '~\?;~', '~\?$|;$|=$~'), array('%22', ';', '?', ''), $url['replacement']);
$context['pretty']['cached_urls'][$url_id] = $url['replacement'];

// Cache only the URLs which will fit, but replace $boardurl first, that will help!
//if (strlen($url_id) < 256 && strlen($url['replacement']) < 256)
// $cache_data[] = array($url_id, str_replace($boardurl, '`B', $url['replacement']));
}


}

// Put the URLs back into the buffer
$context['pretty']['replace_patterns'][] = '~(<a[^>]+href=|<link[^>]+href=|<form[^>]+?action=)(\"[^\"]+\"|\'[^\']+\')~';
foreach ($context['pretty']['replace_patterns'] as $pattern)
$buffer = preg_replace_callback($pattern, 'pretty_buffer_callback', $buffer);
}

// Restore the script tags
if ($context['pretty']['scriptID'] > 0)
$buffer = preg_replace_callback("~\x14([0-9]+)\x14~", 'pretty_scripts_restore', $buffer);

// Return the changed buffer.
return $buffer;
}


No database level calls, no caching I just want to see if you see a difference either positive or negative
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline drewactual

  • Member
  • *
  • Posts: 43
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #11 on: April 03, 2019, 11:30:22 am »
i'll hit that up this eve when the traffic fades.... many thanks once again!

Offline drewactual

  • Member
  • *
  • Posts: 43
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #12 on: April 05, 2019, 01:42:05 pm »
SMF is at my top level directory- i have a publisher function, and a store which are subdirectories... What setting in PrettyURL's do I use to be able to navigate to those directories again?  Currently, it's just cycling back to the boardindex/home page.

I suppose it has something to do with 'skip actions list', but i've not the foggiest how to use it...

and help would be appreciated.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #13 on: April 05, 2019, 01:46:17 pm »
For sub directories requires .htaccess change refer to
https://code.google.com/archive/p/prettyurls/wikis/TroubleShooting.wiki
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline drewactual

  • Member
  • *
  • Posts: 43
    • View Profile
Re: Pretty URLs 2.0.15 forum with >115k posts in just under 8k threads
« Reply #14 on: April 05, 2019, 01:50:44 pm »
dang, man... I hope you make a lot of money off this enterprise of yours, because you've got your freakin' act together, Sir... Outstanding support on a great product, and many thanks.

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
6371 Views
Last post September 11, 2010, 06:21:10 am
by Wickedgood
4 Replies
6073 Views
Last post December 13, 2010, 07:05:12 pm
by SMFHacks
12 Replies
8930 Views
Last post April 07, 2012, 08:25:21 am
by SMFHacks
2 Replies
9165 Views
Last post June 21, 2012, 08:16:38 am
by mjindustry
7 Replies
4236 Views
Last post March 07, 2019, 11:23:09 pm
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal