Webmastersite.net
Register Log In

mod rewrite problem
rewrites only first detal link in category

Comments on mod rewrite problem

gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Feb 01, 2005 - 12:38 PM:

Hi everyone,

haven't been here for a while, now I see there were some changes - sorry Paul for MPing you about the "no post button".

Here is the problem:
I've been using mode rewrite for a while now, but recently noticed that a lot of my pages started to drop from Google's index (I disallow to crawl php files) and today I noticed that links detail url is rewritten only for the first link on the pages and others are original php links
here is example
www.ibsteam.net/wsnlinks/Re..._Estate_USA/South_Carolina

I have 10 latest comments on my home page that link to links details and all of them rewritten just fine http://www.ibsteam.net/wsnlinks/ (scroll down).
Also, when I do search for the web sites it gives an option to see detail page too - rewritten just fine.

I have a feeling that I scrued something up in the displaylinks.tpl file, but can not find what exactly.. or may be not..

Thanks for your help!
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Feb 01, 2005 - 2:22 PM:

I just posted a test link on the left side of a category view
(for example www.ibsteam.net/wsnlinks/Re..._Estate_USA/South_Carolina)
I used href="href="link.php?action=detail&id=328" and it shows it as /links/detail/328 when live.. I still can't figure why in the world other links on the same page in the php format.. I even regenirated counters...
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Feb 01, 2005 - 7:36 PM:

It must be a dumb question as usually, but I already looked over the manual and other forum posts - looked into different suggestions, but weren't unable to fix it sad Any hints would be appreciated.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 01, 2005 - 9:57 PM:

I can't reproduce any such behavior on any site of mine, and I can't think of anything which could cause the first link in a category to be different form the others. Seems to me that it should either work or not work, and there's no sense in it working on one link but not others. Is there any sort of customization there which might be unique in some way?

Since you're using 3.12, trying 3.14 is always worth a try. I haven't tested in 3.12, only 3.14.
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Feb 01, 2005 - 11:17 PM:

Yes, I've changed some stuff and moved things around... but what can make such affect? I'm not ready to update yet.. I've done database alterations, changes to templates etc and I'm afraid I can scrue things up by updating what I aready have.

It is really strange it does it - next link to "Details" is "Comments" and its rewritten everywhere just fine.. really strange. And also I have links on the right side under Featured Areas (SC state) which are rewritten correctly too and my test link looks fine on the left side... the only problem is in the category links except the first one. Kinda frustrating... let me know if you get any ideas at all except updating smiling face Thanks
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Feb 03, 2005 - 7:19 PM:

I finally figured out the reason:

I added only more variable to the "Move your link to the top" for my own purposes and it was breaking up mod rewrite after the first "Move your link to the top" link. Now I don't know how to create a correct mod rewrite to the link with the new variable:
/wsnlinks/link.php?action=sponsor&id=262&sp=1 (added &sp=1)
I enterend the following lines into the .htaccess
RewriteRule ^links/([a-z]+)/([0-9]+)/([0-9]+)$ link.php?action=$1&id=$2&sp=$3
RewriteRule ^links/([a-z]+)/([0-9]+)/([0-9]+)/$ link.php?action=$1&id=$2&sp=$3
but it still doesn't work correctly, is there a file with the mod rewrite in the directory source? And what exactly I shold add?
Thank you
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Feb 07, 2005 - 11:06 AM:

any thoughts?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 07, 2005 - 8:14 PM:

How could the 'move your link to the top' link be related to rewriting, when it's never supposed to be rewritten?

I have noticed that if you link to a details page with link.php?id=x&action=detail that messes it up (needs to be link.php?action=detail&id=x)

Edit: Ah, I see the sponsor link is getting rewritten for some odd reason. Perhaps disabling that will help. Open modrewrite.php and change
   else if (strstr($urls[1][$i] .'.php', 'link.php') && !strstr($urls[2][$i], 'edit'))

to
   else if (strstr($urls[1][$i] .'.php', 'link.php') && !strstr($urls[2][$i], 'edit') && !strstr($urls[2][$i], 'sponsor'))
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Feb 10, 2005 - 11:53 AM:

Thank you very much Paul it work beautifully! Can you suggest any good books to learn PHP except the oficial PHP web site?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#10 - Quote - Permalink
Posted Feb 11, 2005 - 5:31 PM:

Since I used C++ (which is similar in many ways since PHP itself is written in C++) in almost every class in college, it was fairly easy for me to teach myself PHP just using the PHP manual's function reference pages... I also got started on it by making a few little hacks for OpenBB (an old forum script) and then learned in the process of making WSN Links. I've never read any PHP books so I couldn't suggest them.
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
#11 - Quote - Permalink
Posted Feb 13, 2005 - 12:33 PM:

gotcha. Thanks for all your help!
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
#12 - Quote - Permalink
Posted Apr 21, 2005 - 11:46 AM:

This is odd! I had the same problem with mod_rewrite again even though it was before the upgrade from 3.12 to 3.15. The problem didn't resolve after the upgrade, so I used the same fix you suggested above and it fixed it. I think you need to change it in your release once and forever.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.