简体   繁体   English

Apache 2阻止网址,例如example.com/?admin

[英]Apache 2 block url such as example.com/?admin

Please can you tell me in Apache2 how I can restrict a url to my IP address when the url is generated as a script. 请您在Apache2中告诉我,当URL作为脚本生成时,如何将URL限制为我的IP地址。 For example: 例如:

example.com/?admin 

I have tried Location Match but no joy: 我尝试过位置匹配,但没有任何乐趣:

<LocationMatch /?admin>
    Order Deny,Allow
    Allow from [MY IP]
    Deny from all
</LocationMatch>

You could use mod_rewrite to match the %{QUERY_STRING} and disallow anything that's not empty, unless it's from your IP. 您可以使用mod_rewrite来匹配%{QUERY_STRING},并禁止所有不为空的内容,除非这些内容来自您的IP。 Check the wiki for examples. 查看Wiki以获取示例。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 example.com/wp-login.php将我重定向到example.com/example.com/wp-admin - example.com/wp-login.php redirects me to example.com/example.com/wp-admin 如何处理从example.com/search/?s=some到example.com/search/some的URL - How to manipulate the URL from example.com/search/?s=some to example.com/search/some 如何将example.com/index.php#anchor的URL重写为example.com/anchor? - How do I rewrite the URL for example.com/index.php#anchor to example.com/anchor? 传递example.com时,parse_url()返回错误 - parse_url() returns an error when example.com is passed 检测URL标记example.com/page.php#anycontent - Detect URL tags example.com/page.php#anycontent 将example.com/out/1234重定向到另一个URL - Redirect example.com/out/1234 to another URL 像groovehark / twitter这样友好的网址:example.com/#!/whatever - Friendly URL like grooveshark/twitter: example.com/#!/whatever WordPress管理员用户无法访问前端。 WordPress为管理员用户在“ example.com”之后附加“ / admin” - WordPress admin user is unable to reach frontend. WordPress appends '/admin' after 'example.com' for admin users 将example.com重定向到example.com/blog - Redirect example.com to example.com/blog 使用example.com/blog?p=1234将URL重定向到wordpress默认URL(example.com/blog/actual-url-of-post)在Safari中不起作用 - Redirect URL's with example.com/blog?p=1234 to wordpress default URL (example.com/blog/actual-url-of-post) doesn't work in Safari
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM