Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12384
Latest: MildredGarrido
New This Month: 8
New This Week: 0
New Today: 0
Stats
Total Posts: 39888
Total Topics: 7022
Most Online Today: 65
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 24
Total: 24

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

0 Members and 1 Guest are viewing this topic.

Offline drewactual

  • Newbie
  • *
  • 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: 14953
    • 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

  • Newbie
  • *
  • 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: 14953
    • 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

  • Newbie
  • *
  • 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: 14953
    • 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

  • Newbie
  • *
  • 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: 14953
    • 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

  • Newbie
  • *
  • 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

  • Newbie
  • *
  • 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: 14953
    • 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

  • Newbie
  • *
  • 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

  • Newbie
  • *
  • 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: 14953
    • 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

  • Newbie
  • *
  • 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
2 Replies
6808 Views
Last post June 21, 2012, 08:16:38 am
by mjindustry
0 Replies
872 Views
Last post February 10, 2018, 05:52:48 am
by juliereader
6 Replies
3450 Views
Last post July 15, 2018, 04:14:19 pm
by SMFHacks
7 Replies
1408 Views
Last post June 06, 2019, 12:14:53 pm
by SMFHacks
7 Replies
872 Views
Last post March 07, 2019, 11:23:09 pm
by SMFHacks

+- Recent Topics

prettyurls - TroubleShooting.wiki by Rock Lee
October 10, 2019, 11:37:09 am

Some issues with adding and editing a listing by ajac63
October 07, 2019, 04:16:40 am

Problem update 1.1.21 to 2.0.15 by Rock Lee
October 06, 2019, 06:09:16 pm

[Mod]SMF 2.0.x PHP 7.2 Support by sah62
October 04, 2019, 01:46:00 pm

Ideas by shuban
October 03, 2019, 10:19:06 pm

How to space icons and multiple reacts? by shadav
October 03, 2019, 04:20:07 pm

PrettyUrls SEO Pro by Rock Lee
October 01, 2019, 09:09:38 am

How to get search preciser by SMFHacks
September 23, 2019, 10:09:56 am

How to AVOID SEO Hit when Implementing PrettyURLs by SMFHacks
September 12, 2019, 08:50:42 pm

theme by SMFHacks
September 12, 2019, 07:10:51 am

Powered by EzPortal