Problem with php include

Discuss practical ways rearrange URLs using mod_rewrite.

Problem with php include

Postby Krypton » Sat Aug 09, 2008 3:58 pm


I've been using mod rewrite to create 'friendly' urls for example, before when you went to view a tutorial you would see ... erce&id=28

This is now: ... mmerce/28/

My problem is that on that page I have an ajax star rater used for rating the tutorials, for some reason the ratings work when you visit the unfriendly url but don't when you visit the friendly url.

My .htaccess code is

Code: Select all
Options +FollowSymLinks
Options +Indexes

RewriteEngine On

RewriteCond %{http_host} ^www\.tutorialwave\.com [NC]
RewriteRule ^(.*)$$1 [R=301,NC]

RewriteRule ^view/([0-9]+)/$ view.php?id=$1

RewriteRule ^category/(.*)/(.*)/$ tutorials.php?display=sCategory&Category=$1&sCategory=$2 [nc,L]

RewriteRule ^tutorial/(.*)/(.*)/([-a-zA-Z0-9]+)/$ tutorials.php?display=tutorial&Category=$1&sCategory=$2&id=$3 [nc,L]

and the ajax rater gets called by a php include. Does the php include need to be an absolute url like for images and css?

Posts: 8
Joined: Thu Jul 03, 2008 10:25 pm

Postby Krypton » Sat Aug 09, 2008 4:14 pm

After reading the frequently asked questions posted by richardk which I some how missed I figured it out. All i needed to do was put:

Code: Select all
echo '<base href="">';
Posts: 8
Joined: Thu Jul 03, 2008 10:25 pm

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 9 guests