News:

Wondering if this will always be free?  See why free is better.

Main Menu

Pretty URLs

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

Previous topic - Next topic

edwardsiow

hi, eldʌka

after i have installed this mod, can you teach me how to get the links (a thread's link) which are normal without beautifying?


danskmacabre

Quote from: eldʌkaː on March 18, 2007, 07:19:04 AM
In index.php
Code (find) Select
$context['pretty']['board_urls'] = unserialize($modSettings['pretty_board_urls']);
Code (replace) Select
$modSettings['pretty_board_urls'] = str_replace("'", "\\'", $modSettings['pretty_board_urls']);
$context['pretty']['board_urls'] = unserialize($modSettings['pretty_board_urls']);
I'm not sure that's the best fix, I might try adding the slashes into it when I update the database..


I had some major errors appearing, this code fix did the trick.
Thanks  :)
Website: cantref.org.uk chaos8.com | SmF version: 2 | Portal software: PortaMx 1.3 | Default theme: Coal Black

Dannii

Quote from: edwardsiow on March 26, 2007, 12:13:02 PMhi, eldʌka

after i have installed this mod, can you teach me how to get the links (a thread's link) which are normal without beautifying?
Any of the mod buttons aren't beautified at the moment. You can get the topic ID from them.
"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."

SticKer

Installed on my site and it works perfect..

thanks eldʌka for this cool mod..

goitalone

It's only for good looking topic URL's? Do search engines see/display the links the same way on search results??

Dannii

"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."

SticKer

hi eldʌka,

the mod installed perfect yesterday,

but i found one post were it does not show the topic name

it shows like this http://www.orbitforum.com/car-audio/t542/

all the other links are working perfect as they should after i installed the mod but its only this 1 link.

i felt i better inform you so if its a bug u can fix it.

Regards,
SticKer

danskmacabre

Quote from: SticKer on March 28, 2007, 02:00:09 AM
hi eldʌka,

the mod installed perfect yesterday,

but i found one post were it does not show the topic name

it shows like this http://www.orbitforum.com/car-audio/t542/

all the other links are working perfect as they should after i installed the mod but its only this 1 link.

i felt i better inform you so if its a bug u can fix it.

Regards,
SticKer


I've seen that before on my site.
I was doing some testing with the mod and duplicate thread names.
If you have a non-unique (for my site anyway) it put extra characters on the end to make the url unique.

Website: cantref.org.uk chaos8.com | SmF version: 2 | Portal software: PortaMx 1.3 | Default theme: Coal Black

Dannii

Mmm, anything in the error log? Which character encoding do you use?
"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."

SticKer

Quote from: eldʌkaː on March 28, 2007, 02:32:15 AM
Mmm, anything in the error log? Which character encoding do you use?

UTF-8

Dannii

I have no idea why it didn't generate a proper url sorry. We've had similar issues before, but they weren't using UTF-8.
"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."

SticKer

there is an option in the admin panel to convert data and db to utf 8 do u want me to do that

Dannii

I thought you said it already was UTF-8? You can try that, afterwhich you should uninstall the mod, and delete the pretty_topic_urls table and the pretty_urls column from the topics table. If you reinstall the base package, hopefully it will work.

Btw, what version of PHP do you use?
"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."

SticKer

#233
Quote from: eldʌkaː on March 28, 2007, 11:24:38 AM
I thought you said it already was UTF-8? You can try that, afterwhich you should uninstall the mod, and delete the pretty_topic_urls table and the pretty_urls column from the topics table. If you reinstall the base package, hopefully it will work.

Btw, what version of PHP do you use?

i use 4.4.3

will try the uninstall reinstall thingy n c if it wrks..

just wanted to ask u if i run the convertion to utf8 thts in the admin panel, would i face any problems?

jewels

#234
I've spent about two hours trying to get this to work. The good thing, I suppose, is that I received no errors. I've changed the access file accordingly, but to no avail, I cannot get the urls to work. I get 404 error code.

I've read the entire posts here and tried several of ways to get this to work. I really like this mod and don't want to uninstall. But right now, I've set the board on maintenance because every forum link clicked leads to the 404 error page. I assume it may have something to do with the htaccess file.


No one has actually explained clearly what the file coding should look like  (if the file is located inside the root of the smf forum). The name of my forum is "Interact". It is located on a sub domain of my site. What I'm trying to find out is exactly how the htaccess file is suppose to be coded.

I tried moving outside of the smf folder and that didn't work. So, I assume it's suppose to remain inside of the smf folder.

Since the smf root is called "Interact", do I add that name in the htaccess file? If I'm suppose to--I've already done that and it did not work.

If I'm suppose to remove the word "/interact/" from the htaccess file, then I don't know what I'm to replace it with. And also, do I keep the slash and just remove "interact" or do I remove "/interact/" with the slash? Please help. Thanks.

schled

Have you tried using the htaccess file without editing apart from renaming to ".htaccess"? The file probably should be placed in the root directory of your forum.

I didn't make any changes to the contents of the htaccess file itself.

DoA

I have apostrophes in my board URLS and some of my topics. This is causing SMF to error and redirect back to the board index. Is there a way round this??

Great mod! Thanks for all the help!

DoA

jewels

#237
Quote from: schled on March 28, 2007, 04:06:49 PM
Have you tried using the htaccess file without editing apart from renaming to ".htaccess"? The file probably should be placed in the root directory of your forum.

I didn't make any changes to the contents of the htaccess file itself.


I changed the file to .htaccess using ftp
I first tried adding the file to the same directory as the forum (didn't work)
I tried using the file inside the forum folder (didn't work)
Then I added the file to the root of the sub domain (didn't work)

I've removed it for the time being. I'm going to set up a test board to see what's wrong. I don't have but maybe two other mods running, in which I don't think are the problems.

My host allows htaccess, so I know it's not the host.

Here is a copy of it below:


#   Example .htaccess file for the SMF Pretty Urls mod
#   If you already have a .htaccess file you will have to manually edit this and that file together. If not, you should be able rename this file to .htaccess and have it work without any changes. The default options should work, but other possible options are also provided commented out (for example, if you want to change the base location to /forum/)

RewriteEngine on

#   Pretty board urls
RewriteRule ^/interact/([-_!~*'()a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^/interact/([-_!~*'()a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

#   Pretty topic urls
RewriteRule ^/interact/([-_!~*'()a-zA-Z0-9]+)/([-_!~*'()a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1;topic=$2.0 [L,QSA]
RewriteRule ^/interact/([-_!~*'()a-zA-Z0-9]+)/([-_!~*'()a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ ./index.php?pretty;board=$1;topic=$2.$3 [L,QSA]

DoA

jewels - could you copy and paste an erroring URL here, then paste what you THINK it should look like. that may help me. I'll try and help if you can figure my apostrophe problem :P

jewels

Quote from: DoA on March 28, 2007, 04:49:37 PM
jewels - could you copy and paste an erroring URL here, then paste what you THINK it should look like. that may help me. I'll try and help if you can figure my apostrophe problem :P

There is no error url. The mod has been removed. I'm going to re-install the mod on a test board. The only problem I had with the mod was the fact that when I clicked on the links, I get a 404 not found page (as if the url name doesn't exist).



Advertisement: