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

RAN

#3260
Hi Dannii

I have installed Pretty URLs 0.9.1 and sitemap 1.1.2
When I try to access to xml show me this on the webpage.

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.

My error log have this error:

Error log: [Mon Mar 16 16:30:31 2009] [error] [client 00.000.00.000] PHP Fatal error:  Allowed memory size of 25165824 bytes exhausted (tried to allocate 2666271 bytes) in /home/sharinga/public_html/sharing-forums.com/Sources/PrettyUrls-Filters.php on line 16, referer: http://www.topcasinowagering.com/review/europe-mr-green-casino/

Line 16 is: $buffer = preg_replace_callback('~<script.+?</script>~s', 'pretty_scripts_remove', $buffer);

Can you help me please?
Thank you in advance for your help


Dannii

You don't have enough memory?
"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."

RAN

#3262
Hi,

Any way to fix that?

Already try ini_set("memory_limit","30M") ini_set("memory_limit","128M")
Doesn't work

Thank you

Dannii

Maybe make your sitemap smaller, or move to a better host?
"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."

RAN

Hey,

I have 20000 Max number of topics to display in sitemap.
I have reduced to 2000 and works ok.

Thank you very much for your great help

RAN

#3265
Hi again

I don't know if is the right place to putt his question but...

In google my website apears like this
Welcome, Guest. Please login or register. 1 Hour, 1 Day, 1 Week, 1 Month, Forever. Login with username, password and session length

The board is not protected http://www.topcasinowagering.com/review/usa-silver-oak-casino/

I know is related to robots.txt
Any chance to fix this? Can you indicate me a good robots.txt to use with Pretty Url's

Thank you for your great help

Dannii

Are you doing a site: listing? If so, you're not searching, just listing ever file in google. With no search terms it can't show a useful excerpt.
"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."

RAN


AlphaHot1

I've added a couple of modifications, namely in .htaccess:

*removed index.php at the end of the url
*removed www at the beginning of the url
*added a trailing slash to every url it doesn't end with a filename extension

To make pretty urls regenerate the correct .htaccess everytime it is enabled, do the following in Subs-PrettyUrls.php:

find
# .htaccess file generated automatically on: ' . date('F j, Y, G:i') . '

RewriteEngine on


replace
# .htaccess file generated automatically on: ' . date('F j, Y, G:i') . '

RewriteEngine on

# disable index.php
rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php/?\ HTTP/
rewriteRule ^(.*)index\.php/?$ /forum/$1 [R=301,L]

# no-www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/forum/$1 [R=301,L]

# add trailing  slash
RewriteCond %{HTTP_HOST} ^(.+)$ [NC]
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,6}|/)$
RewriteRule (.*)$ http://%1/forum/$1/ [R=301,L]


I've also added hour, minute and second to the backupped .htaccess made by pretty urls (because if you turn it off and on more than a time I day, the old backup will be overwrited):

find
@copy($boarddir . '/.htaccess', $boarddir . '/.htaccess.backup-' . date('Y-m-d'));


replace
@copy($boarddir . '/.htaccess', $boarddir . '/.htaccess.backup-' . date('Y-m-d-H-i-s'));


Why those rewrite lines are good? They are domain independant, so you can release your dev site in production without changing anything.

It's assumed that your forum it's installed in a /forum subdirectory, if it's not the case, just remove any forum/ occurences, or change it accordingly.

The last line add the trailing slash only to urls that don't end with a dot and an extension from 1 to 6 characters long; modify as needed.

Thanks for the great mod :)

DareDevil1990

hi guys before i moved to a new my domain(letsa say abc.com) i had install pretty url one time but it didnt work then i moved to a new domain(lets say xyz.com) because of some problems with the earlier one. i just imported the Db to a new host installed fresh copy of smf editng settings.php and my site was up again after many month i again tried to install pretty url's when i enabled the mod from the admin section something strange happened. i was able to access my site at xyz.com but when i click on a board or admin or pm or anything  i am redirected to abc.com/xxxx/xxxx (my old domain name)
i think some part of my old domain is still in my database,what query do i  run in php my admin or what should i do so anything related to abc.com in deleted from my database and only the xyz.com is in my DB.


Please help


i want this mod real bad but whenever i install this happens.:((

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

DareDevil1990

okay thnx for this it worked ..yay
was havinh problem with arcade but figured tht  i need to disable "Rewrite Action URLs (ie, index.php?action=something)" is this right?

i'll chk my forum around to see if it has some error or not


thank you once again :)

Dannii

There's a fix for the arcade in the extras package,
"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."

ivo2296

Hi Dannii,

What do you think about this?:

When you want to perform a case-insensitive replace,
you use the following code to do it:

<?php
preg_replace
("/word/i","<b>word</b>",$string);
?>


However, there is a problem if you use cyrillic characters
and your host server is Linux - no matter that you use
the "i" parameter after the filter. This is really bad for
Russians and Bulgarians, but there is a solution:

<?php
// Firstly, we need to define some functions which will convert
// our cyrillic string to uppercase or lowercase - strtolower()
// and strtoupper() do not work if your string contains cyrillic
// characters and your server is Linux. 

function cstrtolower($str) {
   return 
strtr($str"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯ""абвгдежзийклмнопрстуфхцчшщъьюя");
}

function 
cstrtoupper($str) {
   return 
strtr($str"абвгдежзийклмнопрстуфхцчшщъьюя""АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯ");
}

// Now we have to define a function which will break apart
// the word for which we are searching in the string in
// groups - lowercase and uppercase in a group, for example
// if we are searching for "word", our filter must looks like 
// this: "/[Ww][Oo][Rr][Dd]/"

function createFilter ($string) {
    
$string cstrtolower($string);
    for (
$i=0;$i<strlen($string);$i++) {
        
$letter_small substr($string,$i,1);
        
$letter_big cstrtoupper($letter_small);
        
$newstr .= '['.$letter_small.$letter_big.']';
    }
    return 
$newstr;
}

// This is cyrillic text. And we are ready to perform the match:

$string "Това е ТексТ на кирилица";
$word "текст";

$newstring preg_replace("/".createFilter($word)."/",
"<b>\\0</b>",$string));

echo 
$newstring;
?>



It is a row example about converting the Cyrillic characters to the Latin ones.

I haven't installed your mod yet cause my forum is based on windows-1251.

DareDevil1990

hey danni from the time i have installed pretty urls the shout box(i am using neenones Advanced AJAX Shoutbox      1.22 )  is geeting closed after like 10-15 sec of the full page being load

take a look at this screeny you'll get what i mean.
http://img22.imageshack.us/img22/3582/dfsadasda.jpg

but i refresh or type the command /return normal sb comes back but it returns to position shown in the above pic :'( helppp

Dannii

Quote from: ivo2296 on March 22, 2009, 05:20:48 PM
Hi Dannii,

What do you think about this?:

When you want to perform a case-insensitive replace,
you use the following code to do it:

<?php
preg_replace
("/word/i","<b>word</b>",$string);
?>


However, there is a problem if you use cyrillic characters
and your host server is Linux - no matter that you use
the "i" parameter after the filter. This is really bad for
Russians and Bulgarians, but there is a solution:

<?php
// Firstly, we need to define some functions which will convert
// our cyrillic string to uppercase or lowercase - strtolower()
// and strtoupper() do not work if your string contains cyrillic
// characters and your server is Linux. 

function cstrtolower($str) {
   return 
strtr($str"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯ""абвгдежзийклмнопрстуфхцчшщъьюя");
}

function 
cstrtoupper($str) {
   return 
strtr($str"абвгдежзийклмнопрстуфхцчшщъьюя""АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯ");
}

// Now we have to define a function which will break apart
// the word for which we are searching in the string in
// groups - lowercase and uppercase in a group, for example
// if we are searching for "word", our filter must looks like 
// this: "/[Ww][Oo][Rr][Dd]/"

function createFilter ($string) {
    
$string cstrtolower($string);
    for (
$i=0;$i<strlen($string);$i++) {
        
$letter_small substr($string,$i,1);
        
$letter_big cstrtoupper($letter_small);
        
$newstr .= '['.$letter_small.$letter_big.']';
    }
    return 
$newstr;
}

// This is cyrillic text. And we are ready to perform the match:

$string "Това е ТексТ на кирилица";
$word "текст";

$newstring preg_replace("/".createFilter($word)."/",
"<b>\\0</b>",$string));

echo 
$newstring;
?>



It is a row example about converting the Cyrillic characters to the Latin ones.

I haven't installed your mod yet cause my forum is based on windows-1251.
I used to have Cyrillic conversion, look back through old versions of Subs-PrettyUrls.php

Quote from: MRDJ on March 22, 2009, 11:57:53 PM
hey danni from the time i have installed pretty urls the shout box(i am using neenones Advanced AJAX Shoutbox      1.22 )  is geeting closed after like 10-15 sec of the full page being load

take a look at this screeny you'll get what i mean.
http://img22.imageshack.us/img22/3582/dfsadasda.jpg

but i refresh or type the command /return normal sb comes back but it returns to position shown in the above pic :'( helppp
I think the shoutbox mod needs to use full non-relative URLs... ask the author about it.
Also, checked your error logs???
"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."

ivo2296

Quote from: Dannii on March 23, 2009, 08:49:09 AM
Quote from: ivo2296 on March 22, 2009, 05:20:48 PM
Hi Dannii,

What do you think about this?:

When you want to perform a case-insensitive replace,
you use the following code to do it:

<?php
preg_replace
("/word/i","<b>word</b>",$string);
?>


However, there is a problem if you use cyrillic characters
and your host server is Linux - no matter that you use
the "i" parameter after the filter. This is really bad for
Russians and Bulgarians, but there is a solution:

<?php
// Firstly, we need to define some functions which will convert
// our cyrillic string to uppercase or lowercase - strtolower()
// and strtoupper() do not work if your string contains cyrillic
// characters and your server is Linux. 

function cstrtolower($str) {
   return 
strtr($str"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯ""абвгдежзийклмнопрстуфхцчшщъьюя");
}

function 
cstrtoupper($str) {
   return 
strtr($str"абвгдежзийклмнопрстуфхцчшщъьюя""АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯ");
}

// Now we have to define a function which will break apart
// the word for which we are searching in the string in
// groups - lowercase and uppercase in a group, for example
// if we are searching for "word", our filter must looks like 
// this: "/[Ww][Oo][Rr][Dd]/"

function createFilter ($string) {
    
$string cstrtolower($string);
    for (
$i=0;$i<strlen($string);$i++) {
        
$letter_small substr($string,$i,1);
        
$letter_big cstrtoupper($letter_small);
        
$newstr .= '['.$letter_small.$letter_big.']';
    }
    return 
$newstr;
}

// This is cyrillic text. And we are ready to perform the match:

$string "Това е ТексТ на кирилица";
$word "текст";

$newstring preg_replace("/".createFilter($word)."/",
"<b>\\0</b>",$string));

echo 
$newstring;
?>



It is a row example about converting the Cyrillic characters to the Latin ones.

I haven't installed your mod yet cause my forum is based on windows-1251.
I used to have Cyrillic conversion, look back through old versions of Subs-PrettyUrls.php

I know that and i have tested it - it had wrong conversion.

sombra

i have a tinny question since pretty url rewrites all url can this afect how google look the pag maybe can it cause google to not index redireccion links like the pretty url? or it dosent give this problem?

and thanks the mod is working fine in my forum


Dannii

Quote from: ivo2296 on March 23, 2009, 02:27:14 PM
I know that and i have tested it - it had wrong conversion.
Ok, well if your code works better, go for it!

Quote from: sombra on March 23, 2009, 06:20:05 PM
i have a tinny question since pretty url rewrites all url can this afect how google look the pag maybe can it cause google to not index redireccion links like the pretty url? or it dosent give this problem?

and thanks the mod is working fine in my forum
I'm not sure what you're asking, but it shouldn't cause any problems.
"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."

sombra

sorry for my bad english let me se...

google dosent like redirecctions what this mod does is redirect or im wrong?

Advertisement: