WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

IT Discussion Forum Having IT issues? Got IT questions? Who doesn't? If you can't get your Apache to work with your MySQL or your php is choking on your ODBC... Let's see if we can help you come up with some ideas.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-06-2008, 11:01 AM
WebProWorld New Member
 

Join Date: May 2008
Posts: 8
punkrazio RepRank 0
Default .htaccess conflict between instruction

hi at all people
im new on this forum
i hope im writing into the right section

i got a little problem with htaccess rules

my instruction:

RewriteEngine ON
RewriteBase /

RewriteRule ^(.*)\.html$ pcategory.php?path=$1 [L]

RewriteRule ^guide-(.*)\.html$ guide.php?guida=$1 [L]



now the problem is

if i visit path.....html so i call pcategory.php?path=.....
everything works good

instead if i call guide-.........html so i call guide.php?guida=......
apache process pcategory.php instead of guida.php

how can i resolve it??
thank you all for help
Reply With Quote
  #2 (permalink)  
Old 05-06-2008, 02:52 PM
wige's Avatar
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,722
wige RepRank 4wige RepRank 4wige RepRank 4wige RepRank 4
Default Re: .htaccess conflict between instruction

Swap the order of the directives, so that the more specific rule gets processed first.
__________________
The best way to learn anything, is to question everything.
Interestingly Average Security Blog
Reply With Quote
  #3 (permalink)  
Old 05-07-2008, 05:15 AM
WebProWorld New Member
 

Join Date: May 2008
Posts: 8
punkrazio RepRank 0
Default Re: .htaccess conflict between instruction

no change

also switching lines
Reply With Quote
  #4 (permalink)  
Old 05-07-2008, 10:18 AM
WebProWorld New Member
 

Join Date: May 2008
Posts: 8
punkrazio RepRank 0
Default Re: .htaccess conflict between instruction

help plzzzz

:'(
Reply With Quote
  #5 (permalink)  
Old 05-07-2008, 10:44 AM
wige's Avatar
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,722
wige RepRank 4wige RepRank 4wige RepRank 4wige RepRank 4
Default Re: .htaccess conflict between instruction

Try changing:
RewriteRule ^guide-(.*)\.html$ guide.php?guida=$1 [L]
to
RewriteRule ^/guide-(.*)\.html$ guide.php?guida=$1 [L]

Although you have the rewrite base directive, that applies to the rewrite only, not the pattern at the beginning. I think that is causing the pattern that starts with guide- to never evaluate as true. But you will also still need the directives to be in reverse order.
__________________
The best way to learn anything, is to question everything.
Interestingly Average Security Blog
Reply With Quote
  #6 (permalink)  
Old 05-07-2008, 11:05 AM
WebProWorld New Member
 

Join Date: May 2008
Posts: 8
punkrazio RepRank 0
Default Re: .htaccess conflict between instruction

This is my htaccess file:

RewriteEngine ON

RewriteBase /www.imexserve.it/

RewriteRule ^product-category\.html$ pcategory\.php [L]

RewriteCond %{REQUEST_URI} !^(.*)guide-(.*)\.html
RewriteCond %{REQUEST_URI} !^(.*)microbiological-test-(.*)\.html
RewriteCond %{SCRIPT_FILENAME} !^(.*)inpage\.php
RewriteRule ^(.*)\.html$ pcategory\.php?path=$1 [L]

RewriteCond %{REQUEST_URI} !^(.*)guide-(.*)\.html
RewriteCond %{REQUEST_URI} !^(.*)microbiological-test-(.*)\.html
RewriteCond %{SCRIPT_FILENAME} !^(.*)inpage\.php(.*)
RewriteRule ^(.*)-page-(.0-9)\.html$ pcategory\.php?path=$1&pg=$2 [L]

RewriteCond %{REQUEST_URI} ^(.*)guide-(.*)\.html
RewriteRule ^guide-(.*)\.html$ guide\.php?guida=$1 [L]

RewriteCond %{REQUEST_URI} ^(.*)microbiological-test-(.*)\.html
RewriteRule ^microbiological-test-(.*)\.html$ mbtest\.php?mb=$1 [L]

RewriteCond %{SCRIPT_FILENAME} ^(.*)inpage.php
RewriteRule ^(.*)\.html$ inpage\.php?permalink=$1 [L]


without these lines:

RewriteCond %{SCRIPT_FILENAME} ^(.*)inpage.php
RewriteRule ^(.*)\.html$ inpage\.php?permalink=$1 [L]

everything works good, instead with that when i try to rewrite a page that access to inpage.php?permalink=...
i got a conflict with these lines:


RewriteCond %{REQUEST_URI} !^(.*)guide-(.*)\.html
RewriteCond %{REQUEST_URI} !^(.*)microbiological-test-(.*)\.html
RewriteCond %{SCRIPT_FILENAME} !^(.*)inpage\.php
RewriteRule ^(.*)\.html$ pcategory\.php?path=$1 [L]

without the rewritecond nothing work except pcategory.php

can u help me plz??
Reply With Quote
  #7 (permalink)  
Old 06-11-2008, 09:01 AM
WebProWorld New Member
 

Join Date: Jun 2008
Posts: 2
Flaviano Fogli RepRank 0
Default Re: .htaccess conflict between instruction

I have approximatively the same issue. Please help!
__________________
/ Flaviano Fogli
Reply With Quote
  #8 (permalink)  
Old 06-12-2008, 06:16 AM
WebProWorld New Member
 

Join Date: May 2008
Posts: 8
punkrazio RepRank 0
Default Re: .htaccess conflict between instruction

Quote:
Originally Posted by Flaviano Fogli View Post
I have approximatively the same issue. Please help!
ive solved

my problem was the pattern (.*)

because that mean every char

if not you have to use some recognizetion char
for example (.*)-t([0-9]+).html
Reply With Quote
  #9 (permalink)  
Old 06-12-2008, 08:03 AM
WebProWorld Veteran
 

Join Date: Jul 2004
Posts: 972
activeco RepRank 2
Default Re: .htaccess conflict between instruction

Removing "[L]" on the first lune should have helped.

^guide-(.*)\.html$ guide.php?guida=$1
__________________
Vote Hussein, vote humanity
Reply With Quote
  #10 (permalink)  
Old 06-13-2008, 07:49 AM
WebProWorld New Member
 

Join Date: May 2008
Posts: 8
punkrazio RepRank 0
Default Re: .htaccess conflict between instruction

negative

thats will be wrong
anyway ive already solved the problem
bye till flaviano posting
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conflict jacobwissler Google Discussion Forum 4 06-14-2006 01:45 AM
email server conflict ldylion214 IT Discussion Forum 7 03-13-2006 03:01 AM
Question re Robots Instruction bblwise Web Programming Discussion Forum 5 06-04-2005 02:55 PM
Personality Conflict wenwilder Graphics & Design Discussion Forum 38 02-27-2005 06:56 PM
Writing An Instruction Ebook About Using Blogger ebe01 Internet Industry 0 01-08-2004 05:14 PM


Search Engine Optimization by vBSEO 3.2.0