Pretty URLs

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

Previous topic - Next topic

Dannii

What did you manually change?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

MultiformeIngegno

Quote from: Dannii on June 03, 2008, 09:13:07 AM
What did you manually change?
With PhpMyAdmin I changed the forum URL (there was a specific entry for the forum url) in smf_pretty_urls_cache.
Before it was rockciclopedia.com/forum now forum.rockciclopedia.com ...
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

L'AltroWeb

Quote from: Nao 尚 on June 03, 2008, 03:14:39 AM
I think that's in QueryString.php...

$scripturl = $boardurl . '/index.php';

Just replace it with:

$scripturl = $boardurl;
Thanks, i've edit like this: $scripturl = $boardurl . '/';
now my url is: http://darkwolf.altervista.org/forum/  :)

Dannii

QuoteWith PhpMyAdmin I changed the forum URL (there was a specific entry for the forum url) in smf_pretty_urls_cache.
Before it was rockciclopedia.com/forum now forum.rockciclopedia.com ...
Did you change everything else with repair_settings.php first?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

4LP3RUZ1

can anything be done for none UTF boards with accented titles and board names?

Godaddy doesn't have UTF codepages installed >:(
Frozen frogs are back :(

Dannii

What encoding are you using? ISO-8859-9?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

4LP3RUZ1

Yes, the mod works, but only for boards and topics with no accented characters... which is not too many :D

edit: oh and I've the snapshot version up now, same results
Frozen frogs are back :(

Dannii

#1807
Are any of them converted? How about Ğ? Can you show me a link to your forum?

Btw, after upgrading to the snapshot, did you empty the pretty_topic_urls table? If you don't the new algorithms in the database won't be used.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

4LP3RUZ1

#1808
I'm reinstalling now, the codepage of sql seems to be latin1,

and I'll try emptying the table as well.

forum is at: http://www.toyotaclubtr.com/

edit: ok topic titles seem to be fine now, but board names are still not there...
Frozen frogs are back :(

Dannii

Good to hear :)
You can now enter new board names through the admin panel.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Dannii

Gigatravels:
Okay firstly upgrade to the latest snapshot. Then disable all the filters.
Make this change to PrettyUrls-Filters.php:
Code (find) Select
$urls[$url_id]['replacement'] = $modSettings['pretty_root_url'] . '/' . $topicData[$url['topic_id']]['pretty_board'] . '/' . $topicData[$url['topic_id']]['pretty_url'] . '/' . $start . $url['match1'] . $url['match3'];
Code (replace) Select
$urls[$url_id]['replacement'] = $modSettings['pretty_root_url'] . '/' . $topicData[$url['topic_id']]['pretty_url'] . '/' . $start . $url['match1'] . $url['match3'];

Make this change to Display.php:
Code (find) Select
if ((isset($context['pretty']['oldschoolquery']) || $context['pretty']['query_string']['board'] != $context['pretty']['board_urls'][$board]) && $modSettings['pretty_enable_filters'])
Code (replace) Select
if (isset($context['pretty']['oldschoolquery']) && $modSettings['pretty_enable_filters'])

Then go to index.php?action=admin;area=pretty;sa=filters and change the topics rules to:
            "rule": [
                "RewriteRule ^ROOTURL([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;topic=$1.0 [L,QSA]",
                "RewriteRule ^ROOTURL([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ ./index.php?pretty;topic=$1.$2 [L,QSA]"
            ]


Save that, and then switch on the topics filter (as well as the actions and profiles filters if you like). Let me know if it works!
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

phpmycoder

#1811
Quote from: gigitravels on May 29, 2008, 05:22:07 PM
all i need is URL's without any board names. so the URL would look like:

www.forum.com/topic/

I will use the sef mod for topics only (not boards).

hey Dannii - here is how i did it (smf 1.1.5):

1. edited htaccess this way:

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



2. in PrettyUrls-Filters.php, line 282:

replaced this line:

$urls[$url_id]['replacement'] = $modSettings['pretty_root_url'] . '/' . $topicData[$url['topic_id']]['pretty_board'] . '/' . $topicData[$url['topic_id']]['pretty_url'] . '/' . $start . $url['match1'] . $url['match3'];

with this line (basically took out the board):

$urls[$url_id]['replacement'] = $modSettings['pretty_root_url'] . '/' . $topicData[$url['topic_id']]['pretty_url'] . '/' . $start . $url['match1'] . $url['match3'];


3. in Display.php, line 77 (// 301 redirects):

replaced this line:

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

with this line:

if ( isset($context['pretty']['oldschoolquery']) && $modSettings['pretty_enable_filters'] )

this is to avoid an infinite loop.


this seems to work but do you believe it impairs any functionality that i didn't consider?


thanks for your help!
gigi

argimiro

Is the converter from SEO4SMF still available? I looked at the googlecode pages but it seems to have gone?

Dannii

Had you already done it? Cause that's just what I suggested (aside from editing the .htaccess file manually rather than the array.)

It won't impair any functionality, it will however have the same performance cost as with using the boards. You could edit the querys but I think it's not worth risking breaking it for what would be only a barely noticeable performance increase.

Argimiro, Yes it's now at http://prettyurls.googlecode.com/svn/trunk/extras/
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

argimiro

Thanks. Your work is most appreciated.

I noticed on SMF 2.0 beta 3.1 that SMF's built-in queryless URL's feature checkbox in "admin > configuration > features & options > options" vanishes when you install Pretty URLs - this is normal?

SEO4SMF seems to have been abandoned. This looks GREAT :)

Dannii

QuoteI noticed on SMF 2.0 beta 3.1 that SMF's built-in queryless URL's feature checkbox in "admin > configuration > features & options > options" vanishes when you install Pretty URLs - this is normal?
It happens in 1.1 too, and always has.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

argimiro

#1816
Sorry to be thick - how do I use install-SMF2-0.php to get the extra filters?

[edit] no worries, figured it out 

[edit again] ack.. thought I had.

I tried wrapping all the files up in a zip & installing them through the SMF 2.0 beta 3.1 package manager - it reported success, but when I tried to enable the SEO4SMF redirection, I got a 500 Server Error.

So I removed it all (restored the backup .htaccess & uninstalled the add-on via package manager) - all OK again. Extra options gone from Pretty URLs admin panel.

I then tried uploading install-SMF2-0.php to /forums/ alongside SSI.php & visiting it with browser. Again it seemed to install OK, but same as before, enabling the SEO4SMF tickbox resulted in 500 Server Error.

I looked in the .htaccess that the add-on created, and there was an entry:


.
.
.
# Rules for: seo4smf
Array
.
.
.


everything else looked sensible in there. Where could i be going wrong?

Dannii

QuoteSorry to be thick - how do I use install-SMF2-0.php to get the extra filters?
Just get all the files put them in a zip file and upload it in the package manager.

And you need to use the latest snapshot not 0.8.3, which do you have?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

argimiro

#1818
Looks like version 0.9 - I downloaded the files from the link you gave, a couple of hours ago.

Saved them all, zipped them up into prettyurlsextras.zip & uploaded them via package manager - it installed just fine. It was just when I checked the SEO4SMF checkbox, that I started getting the 500 errors.

It looks like the .htaccess rules, instead of getting entered into .htaccess, are being inserted as the word 'Array'?



[edit]


gotcha - my actual base version is 0.8.3
my extras version is 0.9

I'll retry with a newer version of the base package

argimiro

Sorted, all's now well with the world, sorry for being dim


Advertisement: