如何使用随机路径访问网址? [英] How to access url with random path?
问题描述
我在ubunbu14.02上使用apache2.4.7和domain.com,现在所有文件都在root文件的根目录下除了json,我想访问url,如:http sub.mydomain.com/path/randomnumbers?param = xxx获取randomnumbers和param,但除非它是http sub.mydoamin.com/或sub.mydomian.com/path,否则php响应请求是base64json.php,它放在sub.mydomian.com/base64json下。 php和sub.mydomian.com/json/base64json.php
I am using apache2.4.7 on ubunbu14.02 with domain.com, right now all files on root except json under root document, I want to access url like : http sub.mydomain.com/path/randomnumbers?param=xxx to get randomnumbers and param, but couldn't unless it's http sub.mydoamin.com/ or sub.mydomian.com/path, the php respond the request is base64json.php, which put under sub.mydomian.com/base64json.php and sub.mydomian.com/json/base64json.php
我尝试使用url rewrite指向它,然后访问虚拟主机中的randomnumbers和param,然后.htaccess,它说:
在这台服务器上找不到请求的URL / json / randomnumbers?param = 23423424。
I tried to use url rewrite to direct to it, then access the randomnumbers and param in virtual host, then .htaccess, it says: The requested URL /json/randomnumbers?param=23423424 was not found on this server.
当我把整个网址放在上面时一个浏览器,它说:
你没有权限访问HTTP sub.mydomain.com/json/ldmVudHMiOlt7InNlc3Npb25JZCI6InMxNTAxMjY0OTIzeDYyZjg4MTNlNjkzMWM5eDU4MjQ0MjY2IiwiaW5zdGFudGlhdGlvbiI6IjUwMDYmNyZWF0aXZlTG9hZGVkIiwidmlld2FiaWxpdHkwME1lYXN1cmFibGUiOnRydWUsInZpZXdhYmlsaXR5N此服务器上的TAxTWVhc3VyYWJsZSI6ZmFsc2V9XX0 =
。
When I put the whole url on a browser, it says: You don't have permission to access http sub.mydomain.com/json/ldmVudHMiOlt7InNlc3Npb25JZCI6InMxNTAxMjY0OTIzeDYyZjg4MTNlNjkzMWM5eDU4MjQ0MjY2IiwiaW5zdGFudGlhdGlvbiI6IjUwMDYmNyZWF0aXZlTG9hZGVkIiwidmlld2FiaWxpdHkwME1lYXN1cmFibGUiOnRydWUsInZpZXdhYmlsaXR5NTAxTWVhc3VyYWJsZSI6ZmFsc2V9XX0= on this server.
这是我的虚拟主机:
...
RewriteEngine On
RewriteRule ^ json / base64json.php [L]
$
.htaccess在var / www / subdomain /:
RewriteEngine On
RewriteRule ^ json / base64json.php [L]
base65json.php与函数的foo.php相同,然后回显数组中的两个元素。
任何想法?
Ann
Here is my virtualhost:
...
RewriteEngine On
RewriteRule ^json/ base64json.php [L]
.htaccess under var/www/subdomain/:
RewriteEngine On
RewriteRule ^json/ base64json.php [L]
The base65json.php is same as foo.php for the function, then echo the two elements in the array.
Any Idea?
Ann
推荐答案
我添加了这部分,重写现在正在运行:
I added this part, the rewrite is working now:
选项FollowSymLinks
AllowOverride所有
要求全部授予
Options FollowSymLinks AllowOverride All Require all granted
Ann
这篇关于如何使用随机路径访问网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!