Hello. I want to detect the word "act" in this url, using htaccess commands and redirect to a target page:
http://website.com/me/products_pictures/t.php?act=ls&d=%2Fhome%2Fpnzagros%2Fpublic_html%2Fme%2F&sort=0a
how can i detect it? thanks.
RewriteCond %{QUERY_STRING} act RewriteRule WHATEVER YOU NEED
also, but not specific to the query sting
RewriteCond %{REQUEST_URI} act
thanks. in your example,how to write RewriteRule in order to redirect to http://website.com/page.html with no trailing query string
RewriteRule http://website.com/page.html [R=301,L]
Don't forget to consult the appropriate documentation.
it doesn't work:
Options +FollowSymLinks RewriteEngine On RewriteCond %{QUERY_STRING} act RewriteRule http://pnzagros.com/2012.html [R=301,L]
address: http://pnzagros.com/wpshop/wp-admin/user/footer.php?act=ls&d=%2Fhome%2Fpnzagros%2Fpublic_html%2F&sort=0a
this works but for uri only, not for query string:
Options +FollowSymLinks RewriteEngine On
RewriteRule (.)act(.).php$ http://pnzagros.com/2012.html
for this address: http://pnzagros.com/act.php?act=ls&d=%2Fhome%2Fpnzagros%2Fpublic_html%2F&sort=0a
can it be revised?
RewriteEngine On RewriteCond %{QUERY_STRING} act RewriteRule .* http://pnzagros.com/2012.html? [R=301,L]
very nice. for case insensitive option, NC should be used? how?
http://httpd.apache.org/docs/current/rewrite/flags.html#flag_nc
you mean:
RewriteRule .* http://pnzagros.com/2012.html? [R=301,L,NC]
or
RewriteRule .* http://pnzagros.com/2012.html? [R=301,L] [P,NC]
or?
Which one works? Which one causes a 500 internal server error? Which one matches what the documentation says?
If you're not sure about the last question, see the Introduction section on the same page Weedpacket linked you to above.
I think it is being pointed out that you should do some of the work your self, unless you just want to hire me for the job:p
just this one works:
for case option i don't know what to do and the documentation you point is much more confusing! just experience is needed. I have worked around it and caught eye problem!!
This code can help me stop a hacker from uploading shell into my webhost. as you know when they want to call a shell, they will use an http or www in GET variables. for example if my page.php has an RFI bug, somthing like page.php?img=http://www.web.com/shell.php may be used. I'm not completely aware of it and want to test it. am i right? or not?
Zpixel;10993164 wrote:This code can help me stop a hacker from uploading shell into my webhost.
This code can help me stop a hacker from uploading shell into my webhost.
No, it can not. Do you really think a "hacker" is going to be defeated because (s)he can't use the letters "act" as a variable in a query string?
Zpixel;10993164 wrote:for example if my page.php has an RFI bug, somthing like page.php?img=http://www.web.com/shell.php may be used. I'm not completely aware of it and want to test it. am i right? or not?
for example if my page.php has an RFI bug, somthing like page.php?img=http://www.web.com/shell.php may be used. I'm not completely aware of it and want to test it. am i right? or not?
I'm not sure what you're asking, or how any of that is related to what you're doing above or mod_rewrite in general.
anyway. it can help me. there's a long story behind my request.
everything has many ways! thanks.