News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Pretty URLs

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

Previous topic - Next topic

schled

Did you try using the htaccess file without editing apart from renaming to ".htaccess"?

jewels

I'm not sure what you mean. Are you asking if I just renamed it and did no further editing?

schled

Quote from: jewels on March 28, 2007, 04:57:13 PM
I'm not sure what you mean. Are you asking if I just renamed it and did no further editing?

Yes. I didn't make any changes to the htaccess file provided apart from placing it in the root directory of my forum and renaming it.

jewels

No.

Does UTF-8 character set has anything to do with the urls working properly? I asked because I remember seeing something in the thread about it.

jewels

Here's a link to the test board. The mod doesn't work on the (new) board either. And this is a different domain.  :(

Test Board

schled

Where is the .htaccess file placed in your structure? Can you post its contents?

jewels

Quote from: schled on March 28, 2007, 06:05:48 PM
Where is the .htaccess file placed in your structure? Can you post its contents?

The ht file is currently inside "interact" folder. "Interact" is the forum's name. Here's another copy of the ht file:

#   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 ^([-_!~*'()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]

#   Pretty topic urls
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]


The one I tried before that is this:

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



In both tries, I place the ht file inside the "interact" folder (the test forum).


Dannii

Quote from: SticKer on March 28, 2007, 12:11:19 PMi 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?
You shouldn't have any problems converting.

The PHP functions I use to convert encodings won't always be present. I think I'll just have to say that UTF-8 is strongly recommened for this mod.


Jewels, can you put up a phpinfo file please?
"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."

jewels

Where can I find the phpinfo file?

I asked about the utf-8 because it's not supported on the database server I'm on.

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

glennk

Hi Guys,

I found the pretty urls mod whilst searching smf community for seo tips. I downloaded it from there and it installed nicely on my forum at :

http://www.whitbyseaanglers.co.uk/forum/index.php

I had a search around in the admin area but couldn't find anything to make the mod work in there.

Would one/some of you kind people let me know what this mod does and how I get it to work please ??

Also I got an error when I first installed the mod. I have now uninstalled and the error went away again.

I am happy to try again if someone could advise me on where I am going wrong.

error said

2: Cannot modify header information - headers already sent by (output started at /mounted-storage/home28b/sub001/sc24906-HICM/glennk/whitbyseaanglers.co.uk/forum/index.php:77)
File: /mounted-storage/home28b/sub001/sc24906-HICM/glennk/whitbyseaanglers.co.uk/forum/Sources/Subs.php
Line: 3202

KIndest regards - Glenn

Dannii

I've answer on the dev forum. I did say the topic or the dev forum ;)
"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."

glennk

ok mate. Will have a look now.  

glennk

Hi Eldaka,

Just wanted to say thankyou for your help with this. I tried to get into the dev forum but kept getting a blank screen. All works fine now and all the urls come up great. Your help has been really appreciated.

Do you know of anyway to manually alter the title ? or description tags ?

Thanks again - Glenn

Dannii

http://dev.eldacar.com/prettyurls/index.php
Sure you get a blank page?
[edit]Hmmm, I do too now. I'll fix it tomorrow.

Title and desciption tags - edit your template. That has nothing to do with this mod 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."

TTP

Thank eldʌka,

The Mode Was great and working
<a href="hxxp:www.talkthepoint.com/ [nonactive]" target="_blank">TalkThePoint.com</a>

Dannii

I've just released version 0.5.
If you have (and only if) changed the root url to something different from $boardurl, then you can try install the actions-ext-none package too. I've changed how the mod works quite a bit this version. Although I didn't change anything in the ext-none package (use 0.4), I plan to change it substantially next time.

Hopefully it works for all of you! :)
"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

There's a minor bug in QueryString.php:
Code (find) Select
$url['replacement'] = preg_replace(array('\"', '~\?;~', '~\?$|;$~'), array('%22', '?', ''), $url['replacement']);
Code (replace) Select
$url['replacement'] = preg_replace(array('~\"~', '~\?;~', '~\?$|;$~'), array('%22', '?', ''), $url['replacement']);
"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."

schled

Thanks again for this great mod! :)

Are there plans to include code to redirect any old URLs (such as those previously indexed by search engines) to the new URL along the lines of this post?

Dannii

I'll be adding in 301 redirects to the next version.
"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."

Advertisement: