Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
i am using mod_rewrite for rewriting urs
problem is whenever a user enter even valid location on my domain (like images) or any other dir..
which i use for static content..
it takes as username also..so how to prevent it ?
i am thinking of to change all dirs names to start with _
so just looking for right .htaccess code to do this..
Thanks in advance
8/22/2022 - Mon
maybe you should tweak a bit
like for user
and in your server configuration, you would take whatever appear after "user/" as the user name.
i believe, this would prevent you to getting "static/" as username too
RewriteRule ^user/([a-z]+)/?$ /usercheck.php?username=$1
RewriteRule ^statc/?$ /statistics.php
using urls as http://mydomain.com/user/username is certainly not a option...as client doesnt want it ..and application is in last stage.. will have to make lot of changes..
what i am looking for is a regex..for Rewriterule so..part which doesnt start with underscore( _ ) only get rewrited ..
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Can you post the regex you are currently use?
change the first character of your regex to [^_] this should prevent matching dirs starting with a _
hernst42, currently i use this rule
RewriteRule ^(.*)/$ view.php?tid=$1
very simple..not i wann it convert so only dirs which doesnt start with _ should use this rule...
i tired putting [^_] in start
http://mydomain.com/_lost/ works fine but when i enter
http://mydomain.com/lokesh it cuts the first chracter and send username to 'okesh' to view .php
how to solve it ?
Thanks for help
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Thaks for help...
to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent