Pretty URLs

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

Previous topic - Next topic

Nao 尚

You'll have to program your own filter for that -- or at least change the output URL to match your needs. It can be done easily when you have some knowledge in PHP. I'm currently playing with my profile links -- http://user.cyna.fr/Nao/ or http://cyna.fr/~1/ -- anything I like... Nice to know :)
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Jpg

#1161
Quote from: Nao 尚 on February 17, 2008, 05:49:59 PM
You'll have to program your own filter for that -- or at least change the output URL to match your needs. It can be done easily when you have some knowledge in PHP. I'm currently playing with my profile links -- http://user.cyna.fr/Nao/ or http://cyna.fr/~1/ -- anything I like... Nice to know :)

I tried doing it, but I don't have access to my server's http.conf file.

So far, all I have is my users set to-
yourdomain.com/username
It goes along side with the other pretty urls.
Actions have the extra "/".


Check out our Smf and TP themes!
http://www.dzinerstudio.com/

Shonick

Quote from: viet on February 17, 2008, 11:45:20 AM
QuoteTo install:

    * Download and install the base package from the mod site.
    * Enable the filters in the Features and Options page
    * If you have changed the base url to something different from $boardurl, you can install the actions-ext-none package too.

I have done the first two parts. When I go to my board. I hover the mouse on the link, it shows me the pretty url, but I click on it I got 404 page.

What exactly the third step mean. I get confuse and do not understand what it mean. My forum on http://domain.com/forum/

Please help me to make it work.

Thank you very much.

Can anyone help me with this please?

After downloading,installing and enabling the filters in the Features and Options page. I got 404 page when I click on the link in my forum.

I put my forum at http://mydomain.com/forum
and .htacess at http://mydomain.com/forum

Please help.

thank you very much.

Dannii

Does your server support .htaccess and mod_rewrite?
"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."

Shonick

Yes, it is. I am using it for my main website and .htaccess in the root folder. I also have another .htaccess locate at domain.com/default

The .htaccess for pretty url is located at http://domain.com/forum

That means now I have total 3 .htaccess files.

I do not know if there are any problem with the one for forum pretty url.

do we have to do any else? I just download the latest snapshot and install it. I also enable it in the admin control. I got the same problem before.

Do I have to do anything else after those steps?







Dannii

You need to check if the one in the root folder is conflicting.
"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."

Shonick

#1166
Thanks, how can I check it. I do not know .htaccess language.

Can you please check for me
this is my file


RewriteEngine on
RewriteRule .*(<|>|;|UNION|SELECT|WHERE).* /go.html [QSA,NC,L]
ErrorDocument 404 http://mydomain.com/error.html



Thank you

Dannii

You can just remove that... I think it's trying to protect against injections, but it's probably quite useless.
"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."

Nao 尚

Yes. SMF already removes UNION statements from queries. And the upcoming SMF2 does a great deal to completely shut down possible malicious injections.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Shonick

I know, but I need it for my main site,not for forum.

So, if I keep it there, is there any way to make pretty url mod to work with my forum.

Or can I move the .htaccess for pretty url to the root. If so, how can I do it?

Thank you

Dannii

You can, just add /forum/ to both the pattern and before 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."

Shonick

Sorry for silly question. I do not know much about .htaccess

Is this correct?

# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: February 18, 2008, 22:07

RewriteEngine on

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

# Rules for: topics
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ ./forum/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)/?$ ./forum/index.php?pretty;board=$1;topic=$2.$3 [L,QSA]

RewriteRule .*(<|>|;|UNION|SELECT|WHERE).* /go.html [QSA,NC,L]
ErrorDocument 404 http://mydomain.com/error.html


or

# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: February 18, 2008, 22:07

RewriteEngine on
RewriteBase /forum

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

RewriteRule .*(<|>|;|UNION|SELECT|WHERE).* /go.html [QSA,NC,L]
ErrorDocument 404 http://mydomain.com/error.html


If I want to use the second one. I guess there will be an error for
RewriteRule .*(<|>|;|UNION|SELECT|WHERE).* /go.html [QSA,NC,L]
right?

If so, how can I correct it.

Thank you.

bluegray

I'm trying to make a custom sitemap and I am getting the pretty urls directly from the database. But I noticed that certain characters like apostrophes are converted to a '' character (hex value 12).
Is there something wrong with my database settings? Or is this normal, and how do I convert it to something usable?

Thanks

BTW. I see the database entries is in latin1_swedish_ci, and I'm pretty sure I converted ti utf a while back. I don't see anything in the admin to do it again...

Dannii

viet, try this:# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: February 18, 2008, 22:07

RewriteEngine on

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

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

RewriteRule .*(<|>|;|UNION|SELECT|WHERE).* /go.html [QSA,NC,L]
ErrorDocument 404 http://mydomain.com/error.html


bluegray, that character is being used instead of a single quote, so you can do a simple str_replace. Encodings shouldn't matter for this mod's tables, though if the main smf tables aren't correct you should fix that.
"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."

Shonick

Thank you very much for your help. Now, it still does not work for me :P.

I think I should stop this for a while. I am really busy now. When I have time, I will check back this mod again. It is wonderful.

Dannii

Well it should work if you just remove the other .htaccess, but okay.
"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."

RickJ

I LOVE this mod.  It's an awesome seo tool!  I've got it on 7 forums and it works fine on all but one:

www.forum.bib-arch.info.

On the features and options page, there is no text for the Filters box (see attached).

When I check the box the mod works fine EXCEPT for our admin only boards.  With the filters enabled, we get the following when going to an admin only baord:

404 Not Found
The requested URL /font-color%5C'0000ff%5C'admin-and-moderator-discussionsfont/0/ does not exist.

Can you help us with a workaround?

Thanks!
Rick.

(I do search before asking, so please pardon me if I missed something :) )

lonrot

I have two big issues.

1) When I write something in the shoutbox, I'll be redirected to 404 not found, even though the message will be posted when I reload. Shoutbox is part of TinyPortal Mod.

2) There are three boards which are uncassesible since I installed Pretty URLS, and even if I uninstall and reinstall again they will keep being 404.

Please check this example:
Board Name: Consolemaniak News
Pretty Address: http://consolemaniak.com/consolemaniak%5C's-news/0/
Real Address: http://consolemaniak.com/index.php/board,1.0.html
If I manually remove the "%5C'" part, the board will show up correctly!

Help me out please!!!

Dannii

RickJ, check your modifications.english.php.
You should completely uninstall the mod removing the database settings, remove the font tags from your boards, and then install the mod again. Hopefully that will work.

lonrot, are you using the 0.8 snapshot?
"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."

RickJ

Quote from: Dannii on February 22, 2008, 12:58:44 AM
RickJ, check your modifications.english.php.
You should completely uninstall the mod removing the database settings, remove the font tags from your boards, and then install the mod again. Hopefully that will work.

Thanks, Dannii.  Will try that.
Rick.

(I do search before asking, so please pardon me if I missed something :) )

Advertisement: