News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Pretty URLs

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

Previous topic - Next topic

cru

Quote from: eldʌkaː on October 17, 2007, 10:17:18 PM
Try replacing it with this cru:
#   Pretty URLs mod
#   http://code.google.com/p/prettyurls/
#   .htaccess file generated automatically on: July 28, 2007, 1:27

RewriteEngine on

#   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]



This is what you told me to replace
#   Pretty URLs mod
#   http://code.google.com/p/prettyurls/
#   .htaccess file generated automatically on: July 28, 2007, 1:27

#   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]


i don't see any difference

2pac

I cant get mine to work properly :(

I had a board called "   the 'stick  " right? with the ' in front of stick.... any way when i tried to get into that board, it gave me an error... so i changed the name of the board, and same thing, it kept the previous name... i even uninstalled the package and installed it back up and it still kept the same name and kept giving me an error... is there a file i need to delete to have it start anew? otherwise i cant use this mod :(

Dannii

Quotei don't see any difference
You need the RewriteEngine line.

QuoteI had a board called "   the 'stick  " right? with the ' in front of stick.... any way when i tried to get into that board, it gave me an error... so i changed the name of the board, and same thing, it kept the previous name... i even uninstalled the package and installed it back up and it still kept the same name and kept giving me an error... is there a file i need to delete to have it start anew? otherwise i cant use this mod :(
Uninstall the mod, then delete all the settings added by the mod. Try the new files from http://prettyurls.googlecode.com/svn/trunk/Base/
"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."

cru

QuoteYou need the RewriteEngine line.

what do you mean?

Quotehttp://prettyurls.googlecode.com/svn/trunk/Base/
what do we do with it? zip then install thru package manager?


Dannii

Quotewhat do you mean?
They're not the same because yours was missing a line.

Quotewhat do we do with it? zip then install thru package manager?
Yep. Make sure you delete the existing database settings though otherwise it won't help.
"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."

cru

QuoteYep. Make sure you delete the existing database settings though otherwise it won't help.
how? does everyone have to do this? coz i think i  experienced the same problem as ninerskickass. I used this mod around a month with no problems, but after a month i don't know which caused the 404error, but i had board titles with " (quotes) in them, and i just noticed the 404errors after a few days.

QuoteThey're not the same because yours was missing a line.
which line? i still don't see any difference.

sorry for asking so many questions, i really like this mod so much, but i don't want to mess anything. TIA

Dannii

Quotehow? does everyone have to do this? coz i think i  experienced the same problem as ninerskickass. I used this mod around a month with no problems, but after a month i don't know which caused the 404error, but i had board titles with " (quotes) in them, and i just noticed the 404errors after a few days.
Yes they will, the code to handle quotes has changed greatly.

Quotewhich line? i still don't see any difference.
The line that says:
RewriteEngine on

Quotesorry for asking so many questions, i really like this mod so much, but i don't want to mess anything. TIA
Don't worry, I don't mind helping anyone. 0.8 should be more user-friendly... :)
"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."

cru

QuoteYep. Make sure you delete the existing database settings though otherwise it won't help.
how do i do this? im no mysql coder...

QuoteThe line that says:
RewriteEngine on
i don't see this line in the code you gave me as a replacement to my .htaccess

Quote0.8 should be more user-friendly...
so, when will 0.8 be available?

Dannii

Quotehow do i do this? im no mysql coder...
http://prettyurls.googlecode.com/svn/trunk/uninstall.php
Download that file and put it in the same place as your SSI.php, then run it, and delete it.

Quotei don't see this line in the code you gave me as a replacement to my .htaccess
It's there... Look up in this post: http://www.simplemachines.org/community/index.php?topic=146969.msg1280589#msg1280589

Quoteso, when will 0.8 be available?
Quite a while to go.. I've got big exams coming up so I don't have much time to work on this.
"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."

cru

thank you man! great support!

cru

#890
it still doesn't support board titles with quotes or '
here's what i did..
1. i followed your instruction
Quotehttp://prettyurls.googlecode.com/svn/trunk/uninstall.php
Download that file and put it in the same place as your SSI.php, then run it, and delete it.

2. i changed my .htaccess as you have instructed
3. i downloaded the files from http://prettyurls.googlecode.com/svn/trunk/Base/  then zipped and installed thru package manager.

4. here's what i got
QuoteType     Action     Description
1.    Execute Modification    ./index.php    Test successful
2.    Execute Modification    ./SSI.php    Test successful
3.    Execute Modification    ./Sources/ManageErrors.php    Test successful
4.    Execute Modification    ./Sources/ModSettings.php    Test successful
5.    Execute Modification    ./Sources/News.php    Test successful
6.    Execute Modification    ./Sources/QueryString.php    Test successful
7.    Execute Modification    ./Sources/Subs.php    Test successful
8.    Execute Modification    ./Sources/Display.php    Test successful
9.    Execute Modification    ./Sources/MessageIndex.php    Test successful
10.    Execute Modification    ./Sources/QueryString.php    Test successful
11.    Execute Modification    ./Sources/Subs-Boards.php    Test successful
12.    Execute Modification    ./Sources/Subs-Post.php    Test successful
13.    Execute Modification    ./Themes/default/ManageBoards.template.php    Test successful
14.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
15.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Test successful
16.    Extract File    ./Sources/PrettyUrls.php    
17.    Extract File    ./Sources/PrettyUrls-Filters.php    
18.    Extract File    ./Sources/Subs-PrettyUrls.php    
19.    Extract File    ./Themes/default/PrettyUrls.template.php    
20.    Extract Tree    ./Themes/default/pretty    
21.    Extract File    ./Themes/default/languages/PrettyUrls.english.php    
22.    Execute Code    install.php

4. So installation  of 0.8 went well.
5. I uploaded Pretty URLs - Actions - Extention: none
When i applied mod:
Quote1.     Execute Modification     ./Sources/PrettyUrls-Filters.php     Test successful
2.    Execute Code    install.php
But when i click install:
QuoteFatal error: Call to undefined function updateFilters() in /home/user/public_html/Packages/temp/install.php on line 37

6. I disregarded this, opened my site, I clicked on topics, and see my urls improved.
7. when i click on topics with ' or quotes, i get this error
QuoteNot Found
The requested URL /ambulleros\'-gallery/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

8. I restored my backup, then started from step 1 without installing the
Pretty URLs - Actions - Extention: none
I still get the same problem.

9. I tried checking the radio buttons for
QuoteRewrite Topic URLs
Rewrite Profile URLs.
thru prettyurls admin

When i go back to the forums, what i only see is my header, user panel and the footer.
I click on Admin, same thing, i only see my header, user panel and footer, so i have no way to uninstall. I have to restore my backup.

10. Does this installation, as stated above affect my db? do i have to restore the db too? coz i just restored the files.

my mods before installation of pretty urls0.8
QuoteSMF1.1.4DefaultTheme. My mods- TP0.9.8, New Topic Button1.0,
Referrals Mod1.4, Ad Managment2.3, SMF Gallery Lite1.8,
YouTube BBC Tag (XHTML Compliant)1.0, SMF Sitemap 1.2.1, Favicon Mod1.0

GOODLUCK ON YOUR EXAMS ELDACAR. Take your time. I know we can make this work.

Dannii

Quotei wonder why quotes do not work on my board, while they are ok on your eldacar's playground?
I don't know either... Can you show me a link to a page that has broken quotes?
"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."

cru

#892
i edited my post above.
QuoteI don't know either... Can you show me a link to a page that has broken quotes?
you won't see the effect now, i restored my backup.

1.in this link http://mydoggy.net/index.php/board,361.0.html
when you click on the first or third topic, it just reloads the same page. It doesn't open the topic.

2. And it is in this board http://mydoggy.net/index.php/board,367.0.html
that i get the
QuoteThe requested URL /ambulleros\'-gallery/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

3. Also in this topic http://mydoggy.net/index.php/topic,303.new.html#new i get the 404 error as quoted above

scwebman

Looks like a great mod here, but when I try to install I get "hacking attempt..."  Is there a fix for this?  Thanks!

Dannii

You're installing it just through the package manager? Anything in the error log?
"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."

Carlos Gandra

#895
Hi,

I'm using pretty-urls on my projects since 0.3 version, but recently, I have installed this mod in a fresh installation of SMF, with encoding utf-8 (portuguese language) and some problems are sometimes happening.

I've also created this topic, with the first issue:
http://www.simplemachines.org/community/index.php?topic=200110.0

This happen two more times, and I have reinstalled pretty-urls again and again to solve. It solves for the detected topic, but days after other topic will be affected. And today, was not a redirection of action=post to action=report, but an action=post to topic Y from the REPLY button on topic X.

I always make clean installations of the mod (using your uninstall.php tool to remove database tables). I also have tried 0.8 from source but the install gives me hacking attempt.

I'm afraid I have to remove definitively this mod, but it will impact on my Forum, cause Google have indexed all the pretty-urls of topics and replies :(
Carlos Gandra
Mundo dos Animais

Dannii

So you click on one thing, but it takes you to something else?

Sounds like you're getting collisions with the CRC hashing... which although unlikely is possible. Have a look at 0.8 when it's released as we won't be using CRCs anymore so collisions won't be possible.
"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 don't think Pretty URLs work properly with moving boards. I tried to move a forum and it told me the ID does not exist. I had to use the drop down box way (which is longer because you have to go through 3 pages to finish it) to move it in the end.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Dannii

Yeah there were some bugs in it, though they've been fixed in the SVN. Do you have to move many more boards?

I think making this change in PrettyUrls-Filters.php will work
Code (find) Select
$pattern = '~' . $scripturl . '(.*)board=([.0-9]+)(.*)~S';
Code (replace) Select
$pattern = '~' . $scripturl . '(.*[?;&])board=([.0-9]+)(.*)~S';
"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

Whoops forgot that I didn't update yet. Thanks.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Advertisement: