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

Cavan

If I check the box to "enable filters" I get blank pages...I'm assuming you're telling me that this is where I need to enable this mod?

If this is the case, I'm uninstalling the mod.

albataur

Hi,
I wrote on the dev board (before server crash) about a problem with accents.
I would to say that I retry today to reinstall the mod and it seems to work fine.
So I don't know why (new version of smf ?) but it works.

Nevertheless, there is something strange ... Accented characters disapear on topics url whereas on boards name accented characters are replaced by the same character without accent. Any explanation ?

Thanks for this mod ! I hope google will love it ;)

Dannii

QuoteI've read in this topic that you need to install other files (actions, profile) for this mod to work but that isn't even mentioned in the first post about this mod. How do you expect users to install this mod properly if you don't bother to explain this in the first place? Don't take that as my being rude but as a legitimate question.
The actions and profile filters are optional. Everything that is needed is found in the single base package. It didn't used to be that way, back in the dark ages of version 0.3, but it's a lot better now ;)

QuoteWhere on earth do you even enable this mod? The only thing in Features and Options is a text box for "Pretty URLs root URL" and a check box to "Enable URL filters"? Is something missing or is that it?
Nope, that's it :) Although I'm working on adding a fuller interface, it will still basically be a tickbox. I want to make it as simple as possible, so that on most servers you don't need to do anything manually outside of SMF's admin panel.

QuoteWhat's all this about an .htaccess file being generated by installing this mod? I already have an .htaccess file in my root directory but this mod has had absolutely NO effect on it.
Is your forum in the root directory, or a subdirectory? The mod makes one in the same location as your forum's index.php, all others will be left untouched, however they may be conflicting (as ourfavwine's are).

QuoteRead me? What "Read Me" file? There ISN'T one....not in the base, profile, or actions files.
I know... I'll get to writing them eventually, but they're not my biggest priority now. I'll get them done before I release version 1.0.

QuoteIf I check the box to "enable filters" I get blank pages...I'm assuming you're telling me that this is where I need to enable this mod?

If this is the case, I'm uninstalling the mod.
Without further information I can't help, but I'm guessing your .htaccess files are conflicting.

QuoteNevertheless, there is something strange ... Accented characters disapear on topics url whereas on boards name accented characters are replaced by the same character without accent. Any explanation ?
Hmmm, are the board and topic tables using the same encoding?
"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."

Cavan

eldʌka:

Yes, my SMF is in the root directory. It doesn't matter now since when uninstalling this mod I received a ton of errors (files missing, etc). I spent the better part of the evening, as I predicted I would, reinstalling SMF and uploading a gleaned back-up (minus any mod variables) of my database (it's a good thing I backup on a regular basis).

Good luck...maybe I'll give this thing a shot another day.

Dannii

QuoteYes, my SMF is in the root directory.
Hmm, does PHP have write access to .htaccess then? You'll probably need to make a custom .htaccess file, but that shouldn't be too hard.

QuoteIt doesn't matter now since when uninstalling this mod I received a ton of errors (files missing, etc). I spent the better part of the evening, as I predicted I would, reinstalling SMF and uploading a gleaned back-up (minus any mod variables) of my database (it's a good thing I backup on a regular basis).
Which files, which errors?
"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."

albataur

QuoteHmmm, are the board and topic tables using the same encoding?
I don't know, I'm on MySQL 4.0.25 so there is no encodage type management. I will try to upgrade to MySQL 5 and I keep you in touch.

Kevin Paquet

Quote from: eldʌkaː on September 29, 2007, 12:06:02 AM
You're getting HACK ATTEMPT still? That code should be in a language file, can you post the whole file here?
This is what I get
// Pretty URLs mod $txt['pretty_root_url'] = 'Pretty URLs root URL
(Without a final slash)
'; $txt['pretty_enable_filters'] = 'Enable URL filters
This may be a substantial performance hit
';

albataur

#788
Tables boards and topics have the same encodage type.

I have constated a new bug. When the topic contains some " the topic is unavailable.

[Edit]
Ok I believe to know where does the problem come.
First, the problem is the same with ' and " than with accents (see my previous messages).

But I noticed :
- in the boards name wich contains " or ', it's replaced by -
- in the topics name it's not replaced

Why is there this difference between topics name and boards name ?

L.G.S

Got a problem with RSS feeds. Because of pretty URLs the link is changed to:

http://www.ruthlessintent.com/board/.xml/?type=rss

and also

http://www.ruthlessintent.com/board/.xml/

But there is nothing there.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


jvan

Has there been a fix for the Javascript arcade error? I browsed this thread, found it mentioned and check the google url that was listed as the place where the solution would be posted, but there's nothing there.

Thanks

Dannii

Quote from: Pasaway on September 30, 2007, 07:24:45 AM
Quote from: eldʌkaː on September 29, 2007, 12:06:02 AM
You're getting HACK ATTEMPT still? That code should be in a language file, can you post the whole file here?
This is what I get
// Pretty URLs mod $txt['pretty_root_url'] = 'Pretty URLs root URL
(Without a final slash)
'; $txt['pretty_enable_filters'] = 'Enable URL filters
This may be a substantial performance hit
';

Can you provide a link to where you get this? Is it on all pages of your forum?

Quote from: albataur on October 01, 2007, 09:29:38 AMTables boards and topics have the same encodage type.

I have constated a new bug. When the topic contains some " the topic is unavailable.

[Edit]
Ok I believe to know where does the problem come.
First, the problem is the same with ' and " than with accents (see my previous messages).

But I noticed :
- in the boards name wich contains " or ', it's replaced by -
- in the topics name it's not replaced

Why is there this difference between topics name and boards name ?
Ahhh, quotes are nasty, although they'll be fixed soon. I don't know why they're different though... Are you using UTF-8?

Quote from: L.G.S on October 01, 2007, 12:16:26 PMGot a problem with RSS feeds. Because of pretty URLs the link is changed to:

http://www.ruthlessintent.com/board/.xml/?type=rss

and also

http://www.ruthlessintent.com/board/.xml/

But there is nothing there.
Ahh, I think I know the solution. Can you post your .htaccess?

Quote from: jvan on October 01, 2007, 02:23:05 PMHas there been a fix for the Javascript arcade error? I browsed this thread, found it mentioned and check the google url that was listed as the place where the solution would be posted, but there's nothing there.
Yes, but only in the development SVN version. I'm really busy with uni, so I'm not sure when I'll be able to complete the next version and release it to you all sorry.
"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."

jvan

Thanks for the reply.

Also, have there been any reports of this mod conflicting with the imageshack mod in 1.1.4? I'm asking because the imageshack mod quit functioning along with the arcade, but I didn't think it might be related until now. That mod also became functional again after disabling the pretty urls filters.  In any event, I appreciate your hard work and will stand by until you're able to work the kinks out.

I don't know how you find the time to have a life and do all of this for free but I am grateful.

L.G.S

# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: September 13, 2007, 7:36

RewriteEngine on

# Rules for: seo4smf
RewriteRule ^(.*)-b([0-9]*)\.([0-9]*)/;(.*) index.php?board=$2.$3;$4 [L]
RewriteRule ^(.*)-b([0-9]*)\.([0-9]*)/$ index.php?board=$2.$3 [L]
RewriteRule ^(.*)-b([0-9]*)\.([0-9])$ index.php?board=$2.$3 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html;((\?:from|msg|new)[0-9]*);(.*)$ index.php?topic=$2.$4;$6 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html;((\?:from|msg|new)[0-9]*) index.php?topic=$2.$4 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html;(.*)$ index.php?topic=$2.$3;$4 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html$ index.php?topic=$2.$3 [L]

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

# Rules for: actions
RewriteRule ^([a-zA-Z0-9]+)/?$ ./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]
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Dannii

Try replacing it with this:# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: September 13, 2007, 7:36

RewriteEngine on

# Rules for: seo4smf
RewriteRule ^(.*)-b([0-9]*)\.([0-9]*)/;(.*) index.php?board=$2.$3;$4 [L]
RewriteRule ^(.*)-b([0-9]*)\.([0-9]*)/$ index.php?board=$2.$3 [L]
RewriteRule ^(.*)-b([0-9]*)\.([0-9])$ index.php?board=$2.$3 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html;((\?:from|msg|new)[0-9]*);(.*)$ index.php?topic=$2.$4;$6 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html;((\?:from|msg|new)[0-9]*) index.php?topic=$2.$4 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html;(.*)$ index.php?topic=$2.$3;$4 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html$ index.php?topic=$2.$3 [L]

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

# Rules for: actions
RewriteRule ^([.a-zA-Z0-9]+)/?$ ./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]
"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."

L.G.S

Nope, I get internal server errors on all pages with that one.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Dannii

Hmm, well thats really strange. Okay put it back to how it was before, and try making this change to PrettyUrls-Filters.php
Code (find) Select
$pattern = '~' . $scripturl . '(.*)action=([^;]+)~S';
$replacement = $boardurl . '/$2/$1';
foreach ($urls as $crc => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url']))
$urls[$crc]['replacement'] = preg_replace($pattern, $replacement, $url['url']);
return $urls;

Code (replace) Select
$pattern = '~' . $scripturl . '(.*)action=([^;]+)~S';
$replacement = $boardurl . '/$2/$1';
foreach ($urls as $crc => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url'], $matches))
if ($matches[2] != '.xml')
$urls[$crc]['replacement'] = preg_replace($pattern, $replacement, $url['url']);
return $urls;
"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."

L.G.S

I still get the 404 even with that
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Dannii

Are you sure you made the change to the right file? It should now just use the normal URLs for the feeds (with index.php).
"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."

L.G.S

Checked and double checked.

Sorry I meant I get the 404s for the RSS link, not the entire forum.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Advertisement: