views:

302

answers:

2

In my script, this function parts build links:

if ($type == "mod_rewrite") {
    $prepend = "";
    $append = ".html";

} else if ($type == "query_string") {
     $prepend = 'index.php?params=';
     $append = "/";
}
//
//
//
    $gamelink = 'game/id/gamename' (example)
    /* 'game' is a fixed string.  
        'id' and 'gamename' are variables) */

and my .htacess is as below:

RewriteEngine on
RewriteRule  ^(.*)\.html$ index.php?params=$1 [NC,L]

The Problem:

I have in game page a ajax rating bar which works perfectly in query string mode:

(in this examples: gamename = 'Arm Copter' and gameid = '3')

Game link:

http://localhost/gss/index.php?params=game/3/Arm-Copter/

Rating link (mouse-over stars images)

http://localhost/gss/plugins/ajax_star_rater/db.php?j=10&q=arm_copter&t=127.0.0.1&c=10

Using ModRewrite: Game Link:

http://localhost/gss/game/3/Arm-Copter.html

Rating Link (stars missing, show only numbers correspondent to stars):

http://localhost/gss/game/3/plugins/ajax_star_rater/db.php?j=10&q=arm_copter&t=127.0.0.1&c=10

The problem here, seems to be url part 'game/id/' inserted, because the correct path to db.php is:

http://localhost/gss/plugins/ajax_star_rater/db.php

and not:

http://localhost/gss/**game/3/**plugins/ajax_star_rater/db.php

I spent 2 days searching and testing various approaches, but i don't found a solution. I need a rule which don't rewrite the ajax rating bar or rewrite to correct paths.

Regards,

Junior Senior - Brazil.

A: 

In the html for the rating link that calls the plugin (http://localhost/gss/game/3/plugins/ajax_star_rater/db.php) you are probably using a relative path from the current folder, sounds like you need to use a path relative to the root folder.

Instead of:

<a href="plugins/ajax_star_rater/db.php">Rate me!</a>

You need to add a start the link with / and write the full path to the script:

<a href="/gss/plugins/ajax_star_rater/db.php">Rate me!</a>

Hope that helps.

Peter Di Cecco
A: 

Great!! Wowww!! This works fine. You are the man! I just edited this lines in the files related to ajax star rater and all works now... :)
Thank you very much !!!

Junior Senior
Brazil.