php mod_rewrite

  • assaf
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 40
  • Status: Offline

Post March 22nd, 2010, 6:08 pm

Hi

I'm trying to create tag pages based on one php page that will be re-written to the tag/[tag].html

I'm not a programmer so my question is pretty basic. What I have done until now is to create the tagdetail.php and a call to the tag pages that have this address mydomain .com/tag/[$tag_dash].html (example: mydomain .com/tag/mortgage.html). In addition I have added a this line to the .htaccess file:
RewriteRule ^tag/.*\.html$ tagdetail.php?tag_dash [L]

From what I understand, it looks like the tagdetail.php "doesn't know" it is being called.
What should I add or fix in order that it will be called?

Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 22nd, 2010, 6:08 pm

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post March 23rd, 2010, 7:13 am

try the following:
Code: [ Select ]
RewriteRule ^tag/(.*)\.html$ tagdetail.php?tagdash=$1 [L,QSA]
Let's leave all our *plum* where it is and go live in the jungle ...
  • assaf
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 40
  • Status: Offline

Post March 23rd, 2010, 7:27 am

righteous_trespasser wrote:
try the following:
Code: [ Select ]
RewriteRule ^tag/(.*)\.html$ tagdetail.php?tagdash=$1 [L,QSA]


Thanks.

I get a blank page like I got before (it is not a 404).
It looks like the issue is even before the rewrite. The page is not loading any content at all.
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post March 23rd, 2010, 7:33 am

It's kinda tough for me to say ... do you have code you can show me ... ?
Let's leave all our *plum* where it is and go live in the jungle ...
  • assaf
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 40
  • Status: Offline

Post March 23rd, 2010, 7:39 am

righteous_trespasser wrote:
It's kinda tough for me to say ... do you have code you can show me ... ?

Yes, but I'm not feeling comfortable putting it on a public site. Is there a way I can send you the files?
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post March 23rd, 2010, 7:48 am

Well the whole idea behind ozzu is for people to have their questions answered by other people ... it is nice to see examples as I am looking through forum posts so I can implement these examples on my site ...

You can however send me a PM (Private Message) ... I am leaving work now and my internet at home is off because internet in South-Africa is just too rediculously expensive. I will be back tomorrow at 8 AM CAT (+2) - that is 16 hours from now ... and I can try and assist you some time then ...
Let's leave all our *plum* where it is and go live in the jungle ...
  • assaf
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 40
  • Status: Offline

Post March 23rd, 2010, 8:01 am

I do understand it and even don't mind that you'll post the relevant code part that is safe to share publically after you'll see it.

Since I have a window of 16 hours until you are back to "internetland" I'll keep trying solving it and update/pm you later.

Your help is much appreciated, thanks
  • assaf
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 40
  • Status: Offline

Post March 24th, 2010, 12:39 am

I was trying to post the code of two files but since they contain links the forum does not allow it.

I don't want to remove the links in the code since it will hurt the integrity of your inspection.

How can we by pass it?
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post March 24th, 2010, 12:50 am

what do you mean that the forum doesn't allow links? I thought that was only for the first ten or so posts ... ?
Let's leave all our *plum* where it is and go live in the jungle ...
  • assaf
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 40
  • Status: Offline

Post March 24th, 2010, 12:59 am

righteous_trespasser wrote:
what do you mean that the forum doesn't allow links? I thought that was only for the first ten or so posts ... ?

When I try to post it says please remove links.
  • assaf
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 40
  • Status: Offline

Post March 24th, 2010, 1:08 am

assaf wrote:
righteous_trespasser wrote:
what do you mean that the forum doesn't allow links? I thought that was only for the first ten or so posts ... ?

When I try to post it says please remove links.


Oh, I see it is possible to post attachments, so here they are:

Note: At the bottom of every article at RealEstateProArticles .com you'll find the tags. If you'll click on them you'll get a blank page and not the content that is expected. Even if there is a mistake in fetching the data, I still expect to see the top, side nav bars and bottom areas on the page instead of blank.

Please let me know if you need additional information.

Thanks
Attachments:
php files.zip

(2.92 KiB) Downloaded 206 times

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post March 24th, 2010, 1:19 am

I am looking at it and I don't quite get what is going on in those files ... What are they supposed to do?

And what EXACTLY is the issue you are having ... ?
Let's leave all our *plum* where it is and go live in the jungle ...
  • assaf
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 40
  • Status: Offline

Post March 24th, 2010, 1:36 am

righteous_trespasser wrote:
I am looking at it and I don't quite get what is going on in those files ... What are they supposed to do?

And what EXACTLY is the issue you are having ... ?


I'm trying to have tags (these are viewable at the bottom of every article on the site).
When clicking on the tags from the article pages I should get (currently) 5 articles that have that specific tag (keyword). The tag page that should be opened is tagdetail.php

Currently, when clicking on a tag (from an article page), all I get is an empty page. Not even the side bars, top etc'
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post March 24th, 2010, 1:55 am

on the top of that page add the following (just for debugging):
Code: [ Select ]
<?php error_reporting(E_ALL); ?>

and then see if you get any php errors ...
Let's leave all our *plum* where it is and go live in the jungle ...
  • assaf
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jun 08, 2006
  • Posts: 40
  • Status: Offline

Post March 24th, 2010, 1:59 am

righteous_trespasser wrote:
on the top of that page add the following (just for debugging):
Code: [ Select ]
<?php error_reporting(E_ALL); ?>

and then see if you get any php errors ...

Added to tagdetail.php
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 24th, 2010, 1:59 am

Post Information

  • Total Posts in this topic: 32 posts
  • Users browsing this forum: No registered users and 250 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.