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

Blinker

Quote from: Dark-Wolf on June 10, 2009, 09:07:11 PM
@Saleem: to remove in advance this problem i've edit Subs-PrettyUrls.php like this:
Quote/*'!'   =>   array ('!'),
      '~'   =>   array ('~'),
      '*'   =>   array ('*'),
      "\x12"   =>   array ("'", '"'),
      '('   =>   array ('(', '{', '['),
      ')'   =>   array (')', '}', ']'),
      '$'   =>   array ('$'),*/
now my urls is perfect ;)
(u can find more info in old post of this topic) :)

I just had a huge screw up on my forum when I split off about 50 posts from a topic and named the newly split topic with a ! in it.

I ended up with a every subject line of every post in the new thread having about 200 forward slashes in it (////////////////////////////////////////////////////////////////////////////////////.......and lots more). It took me ages to edit each one. I had to because the board index and thread view scrolled to the right about a page and a half!

I applied that edit to Subs-PrettyUrls.php and in NotePad++ it turned the entries green like they've been commented out. Is that what's happened? Does it mean those symbols are being ignored by PrettyURLs and my issue will not happen again?

Normally I wouldn't mind searching back through a topic, but this one is 150 pages! I just want to know the pros and cons of the edit (in brief), thanks. :)

Dannii

Are any of those posts still like that? Can you show me a link?
"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."

Blinker

Hi Dannii

No, I edited all the post titles already, and even if I hadn't my forum is private so I couldn't supply a link.

This is what they became after the split -

Help! People Think I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

The title I typed in was "Help! People Think I'm [and then a few more words I can't put here, but two words had apostrophes ' in them].

What you see in bold is exactly what the result was, down to the last backslash.

BTW using 1.1.9 and 0.9.3.

Dannii

Well it's definitely got absolutely nothing to do with !s! If you get it again let me know, without fixing it first.
"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."

Blinker

Fair enough. I thought I'd post only because I read this post - http://www.simplemachines.org/community/index.php?topic=146969.msg2103347#msg2103347

and then your reply and Dark-Wolf's reply with the array edit. Figured it was worth checking out.

Özgür

Actions to subdomain.

If you have a server or your server support wilcard dns, you can onvert your actions to virtual subdomain.

You must edit PrettyUrls-Filters.php.
Actioan callback should be
// Filter miscellaneous action urls
function pretty_urls_actions_filter($urls)
{
global $boardurl, $context, $scripturl;

$pattern = '~' . $scripturl . '(.*)action=([^;]+)~S';
$replacement = 'http://$2.site.com/$1';
foreach ($urls as $url_id => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url'], $matches))
if (in_array($matches[2], $context['pretty']['action_array']))
$urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);
return $urls;
}


Add this to your main httaccess
# Rewrite sub domains.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^www\.site\.net$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.site\.net$ [NC]
RewriteRule ^(.*)$ /forum/index.php?action=%2 [QSA,L]

Run pretty maintenance and actions should be profile.site.com, pm.site.com etc =)
So Long

milicik

When i instal Pretty url I can use Quote and modify inline  :'(


how to fix it

Özgür

Quote from: milicik on June 11, 2009, 10:56:51 AM
When i instal Pretty url I can use Quote and modify inline  :'(


how to fix it
What :S
If you can use, what is the problem O_o
So Long

milicik

Quote from: [Daydreamer] on June 11, 2009, 11:13:04 AM
Quote from: milicik on June 11, 2009, 10:56:51 AM
When i instal Pretty url I can use Quote and modify inline  :'(


how to fix it
What :S
If you can use, what is the problem O_o


I cant use it


Arkangel

#3729
You can block messages from the following titles:
!
"
[]
¡¡

could be .. thanks


   
I'm guessing they're using relative URLs, and you need to change them to absolute URLs.

as change that?

milicik

Quote from: Arkangel on June 11, 2009, 03:37:53 PM
You can block messages from the following titles:
!
"
[]
¡¡

could be .. thanks

wtf?  :-X

Arkangel

relative URLs, and you need to change them to absolute URLs.

as change that?

milicik

Quote from: Arkangel on June 11, 2009, 04:12:24 PM
relative URLs, and you need to change them to absolute URLs.

as change that?


how to do that

Arkangel

#3733

where is the file, that i have to edit the absolute URLs

Leemy

#3734
Please help me I installed Pretty URLs 0.9.3 and it said it installed successfuly. I went to Admin panel and enabled URL rewrite and now EVERY SINGLE TOPIC AND BOARD gives me a 404. I thought you said it all transfers over????

Everything is like : The requested URL /discuss/off-topic/who-saw-the-sardar-all-up-in-kobe's-face-(game-3)/msg58514/ was not found on this server.

PS - I already ran your PHP code posted in the troubleshooting section!

Leemy

So that you dont think its the parentheses thats messing it up, all URLs are failing
/discuss/admin/?area=pretty;sa=settings;save
for an example.

I was able to revert for now.. very hesitant to move forward.  Please advise.

milicik

in public create new fille like fix.php

in this php enter

<?php
require_once(dirname(__FILE__) . '/SSI.php');
updateSettings(array('pretty_enable_filters' => '0'));
?>

and save fille.



Run like this www.yourdomain.com/fix.php

and you will disable pretty url.


There is probably a problem with your server (it may not support mod_rewrite or per-directory .htaccess configuration files).

milicik

I can't quote posts and i can't inline modify posts. After unistalig Pretty URL all is OK, but i want to have pretty url


Help , Tnx Milan

Leemy

#3738
Confirmed with my host that mod_rewrite and per-directory .htaccess are supported.

Dannii

Quote from: [Daydreamer] on June 11, 2009, 10:36:55 AM
Actions to subdomain.

If you have a server or your server support wilcard dns, you can onvert your actions to virtual subdomain.

You must edit PrettyUrls-Filters.php.
Actioan callback should be
// Filter miscellaneous action urls
function pretty_urls_actions_filter($urls)
{
global $boardurl, $context, $scripturl;

$pattern = '~' . $scripturl . '(.*)action=([^;]+)~S';
$replacement = 'http://$2.site.com/$1';
foreach ($urls as $url_id => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url'], $matches))
if (in_array($matches[2], $context['pretty']['action_array']))
$urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);
return $urls;
}


Add this to your main httaccess
# Rewrite sub domains.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^www\.site\.net$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.site\.net$ [NC]
RewriteRule ^(.*)$ /forum/index.php?action=%2 [QSA,L]

Run pretty maintenance and actions should be profile.site.com, pm.site.com etc =)
Ooohhh cool! Could I include this in an 'experimental' package?

Quote from: milicik on June 11, 2009, 10:56:51 AM
When i instal Pretty url I can use Quote and modify inline  :'(


how to fix it
Check your Javascript error console please.

Quote from: Saleem on June 11, 2009, 05:50:59 PM
Please help me I installed Pretty URLs 0.9.3 and it said it installed successfuly. I went to Admin panel and enabled URL rewrite and now EVERY SINGLE TOPIC AND BOARD gives me a 404. I thought you said it all transfers over????

Everything is like : The requested URL /discuss/off-topic/who-saw-the-sardar-all-up-in-kobe's-face-(game-3)/msg58514/ was not found on this server.

PS - I already ran your PHP code posted in the troubleshooting section!
Quote from: Saleem on June 11, 2009, 07:40:12 PM
Confirmed with my host that mod_rewrite and per-directory .htaccess are supported.
Try adding a RewriteBase / line to the top of your .htaccess file.
"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: