XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
Moderator: General Moderators
mydimension
Moderator
Posts: 531 Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:
Post
by mydimension » Mon Dec 16, 2002 5:11 pm
that is because both of those urls match the first pattern. you need to define a pattern that is unique to all of those so that mod_rewite can differentiat between them.
fariquzeli
Forum Contributor
Posts: 144 Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:
Post
by fariquzeli » Mon Dec 16, 2002 5:16 pm
can you give me an example? Sorry, I'm sort of new to mod_rewrite
mydimension
Moderator
Posts: 531 Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:
Post
by mydimension » Mon Dec 16, 2002 9:15 pm
for this particular example this would work:
Code: Select all
RewriteEndinge On
RewriteRule ^products/(.*)\.phtml$ products.php?type=$1
RewriteRule ^details/(.*)\.phtml$ detail.php?urltitle=$1
RewriteRule ^(.*)\.phtml index.php?pname=$1
granted you will have to change most of your links around but this was the easiest solution for me to come up with.
fariquzeli
Forum Contributor
Posts: 144 Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:
Post
by fariquzeli » Tue Dec 17, 2002 1:54 pm
anyone?
mydimension
Moderator
Posts: 531 Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:
Post
by mydimension » Tue Dec 17, 2002 8:46 pm
i think i know whats up. try this:
Code: Select all
RewriteEngine On
RewriteRule ^products/(.*)/\.phtml$ products.php?type=$1
RewriteRule ^details/(.*)/\.phtml$ detail.php?urltitle=$1
RewriteRule ^(.*)/\.phtml$ index.php?pname=$1
fariquzeli
Forum Contributor
Posts: 144 Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:
Post
by fariquzeli » Wed Dec 18, 2002 2:00 pm
wouldn't this make the links turn out to be:
products/productName/.phtml
details/detailName/.phtml and
product/.phtml ?
cause none of these worked when I tried it, only when I removed the second / would the links work.
Is there a possibility I'm missing something in my apache config?
mydimension
Moderator
Posts: 531 Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:
Post
by mydimension » Wed Dec 18, 2002 5:31 pm
sorry, i must have been out of it. your right. as to the problem, im not to sure. seems very odd indeed.
fariquzeli
Forum Contributor
Posts: 144 Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:
Post
by fariquzeli » Wed Dec 18, 2002 8:16 pm
its alright, i'll just use the 2 I have working and keep the rest of the links the same.