HighDots Forums  

Mod_rewrite/PHP problem driving me crazy!!

Search Engine Optimization Discussion about SEO/Search Engine Optimization (alt.internet.search-engines)


Discuss Mod_rewrite/PHP problem driving me crazy!! in the Search Engine Optimization forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Borek
 
Posts: n/a

Default Re: Mod_rewrite/PHP problem driving me crazy!! - 10-24-2006 , 03:02 AM






On Tue, 24 Oct 2006 04:24:43 +0200, David
<seodave (AT) search-engine-optimization-services (DOT) co.uk> wrote:

Quote:
I added the two sets of links so the differences can be seen between
working (top) and failing (bottom). When the problem is solved only
one version will remain in the end script.
That's obvious, I was referring to these details just to precisely
describe my actions.

Quote:
What you see with the %20 version is when it works and the other -
version when it fails and gives the equivalent of an error page, it
tries to find say Crazy-Frog and fails, that is the problem how do I
get this script to recognise Crazy-Frog in place of Crazy Frog (or
Crazy%20Frog, Crazy+Frog).
So far so good. That's what I have guessed.

Quote:
This bit-

$trimcat=$aname;
if (strlen($trimcat)>24){
$trimcat=substr($trimcat,0,21) . $dot;}
if ($aname==$cat){
echo'<strong>'.$trimcat.'</strong> |';}
else{

Is responsible for the strong text, so if $aname==$cat it prints a
trimmed version (1st 21 characters) of the category name minus the
link code. Pretty sure this isn't part of the problem per se.
And that's where I get lost. Your code in this place is not able to
properly compare two values - one from internal (CSV) source and one from
external (URL) source, so that's where the bug can be pinned down by
examining variables values, one is not what you expect it to be. Yet you
know that's not part of the problem - so your problem must be completely
different.

Quote:
The reason the hyphenated version isn't bold is because $aname==$cat
isn't the same Crazy Frog ($aname) is not the same as Crazy-Frog
($cat).

Or I have no idea what you are asking about
As stated.

Borek
--
http://www.chembuddy.com
http://www.ph-meter.info
http://www.terapia-kregoslupa.waw.pl


Reply With Quote
  #12  
Old   
David
 
Posts: n/a

Default Re: Mod_rewrite/PHP problem driving me crazy!! - 10-24-2006 , 11:40 PM






On Mon, 23 Oct 2006 03:15:32 GMT, David
<seodave (AT) search-engine-optimization-services (DOT) co.uk> wrote:

Quote:
Trying to convert a script to use friendly URLs, I've done this
before, but my PHP skills are basic so I'm not great at PHP.
Managed to solve the main problem-

http://www.temphelpwnc.com/Real-Musi.../Crazy-Frog/1/ working now
:-)

Only minor issues left now.

David
--
WordPress Themes with AdSense ads
http://www.morearnings.com/category/wordpress-themes/
AdSense Tips http://www.morearnings.com/2006/05/08/adsense-revenue/


Reply With Quote
  #13  
Old   
Rik
 
Posts: n/a

Default Re: Mod_rewrite/PHP problem driving me crazy!! - 10-24-2006 , 11:51 PM



David wrote:
Quote:
On Mon, 23 Oct 2006 03:15:32 GMT, David
seodave (AT) search-engine-optimizat...es (DOT) co.uk> wrote:

Trying to convert a script to use friendly URLs, I've done this
before, but my PHP skills are basic so I'm not great at PHP.

Managed to solve the main problem-

http://www.temphelpwnc.com/Real-Musi.../Crazy-Frog/1/ working now
:-)

Only minor issues left now.

Well, just keep in mind that you don't HAVE to split everything up in neat
GET variables ready to point to a single action.

A crude, but workable example:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)$ default.php?link=$1&%{QUERY_STRING} [L]

Will neatly throw everything that does not exist to $_GET['link'] in
default.php, where your options of processing requests are way more
versatile. (explode('/',$_GET['link']) for instance)
--
Rik Wasmus




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.