PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 4824

PostPosted: Wed Mar 05, 2008 9:54 am Reply with quote Back to top

I know this is going to be really simple buy I just cannot see the wood for the tree's....
I have a script which outputs a url;
Code:
/reviewer_about/Guardian.php?


The link is formulated from the construct
Code:
/reviewer_about/$username2.php?


The current re-write rule is;
Code:
RewriteRule ^reviewer_about/([^/])\.php reviewer_about.php?username=$username2  [QSA,L]


The correctly re-written link should be in the form of
Code:
/reviewer_about.php?username=Guardian


Anyone have any idea's where the re-write rule is failing or why?
Personally I don't think it's worth bothering re-writing this but that is how the original author has done it and it will save me recoding about 20 files if anyone can help.
View user's profile Send private message Send e-mail Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15221
Location: Kansas

PostPosted: Wed Mar 05, 2008 3:58 pm Reply with quote Back to top

Have you tried turning the log level on to see exactly where the rule is going wrong? This can't be done in .htaccess. It must be done in httpd.conf.

Add these two directives to your httpd.conf immediately after RewriteEngine On
#
# name it whatever you want
#
RewriteLog “/some_path/rewrite_log”
#
# can be 0-9. The higher the number the more verbose
#
RewriteLogLevel 3
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7459
Location: Arizona

PostPosted: Wed Mar 05, 2008 6:37 pm Reply with quote Back to top

Guardian, I am not sure what QSA is, but that rewrite rule does not look right to me. Does the following work?

RewriteRule ^reviewer_about/([^/.]*)\.php reviewer_about.php?username=$1 [QSA,L]

I won't really like how open that is, so if you had restrictions on user names, you might want to restrict that rule a bit.

Edited: I also added in the "." in-between the []. If it causes issues, take it out.
View user's profile Send private message Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7459
Location: Arizona

PostPosted: Wed Mar 05, 2008 6:40 pm Reply with quote Back to top

Just looked up QSA. Sorry... should have done that previously. My question to you is do you really need it? If you take the "QSA," out of my rule, doesn't it work?
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 4824

PostPosted: Thu Mar 06, 2008 12:48 am Reply with quote Back to top

Thanks for the info guys, I'll be checking all this out as soon as I have woken up properly.
M you could be right about not needing QSA, I think someone just got hold of the fact that "it will append any variable between a pattern match to the end of the url" and went with it instead of looking deeper.
The username is restricted to alpha-numeric.
I can see how QSA might be useful in nuke as an example if you wanted to pass $title or something with useful SEO content to the end of a url (food for thought?) but this thing only passes the username and for other stuff an integer is used so the usefulness for SEO is questionable in my eyes.
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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 vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum