Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 正在设置。使用SSL访问子域_Apache_.htaccess - Fatal编程技术网

Apache 正在设置。使用SSL访问子域

Apache 正在设置。使用SSL访问子域,apache,.htaccess,Apache,.htaccess,我的主机中有一个脚本,在/public_html/assets/api/images/api.php或 现在,我尝试使用.htaccess通过访问来为它命名 我在/home/mydomain/assets/api/images中创建了一个.htaccess,我在其中输入了以下代码: RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILE

我的主机中有一个脚本,在/public_html/assets/api/images/api.php或

现在,我尝试使用.htaccess通过访问来为它命名

我在/home/mydomain/assets/api/images中创建了一个.htaccess,我在其中输入了以下代码:

RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 

RewriteEngine On
RewriteBase /


RewriteRule ^(.*) api.php?category=$2&id=$3&type=$4&size=$5&file=$6 [NC,QSA]
.htaccess将接收具有以下语法的URL:

products/87/flyer/md/c4Nrlh_WyrrS-SBEFzwl.png

但它不起作用。字符串传递了空值,我得到:

类别=&id=&type=&size=&file=

完整值仅为$1字符串,未拆分为$2、$3、$4

produtos/87/flyer/md/c4Nrlh_WyrrS-SBEFzwl.png

有人能帮我修一下吗?谢谢

我成功了

RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 

RewriteEngine On
RewriteBase /


RewriteRule ^([a-zA-Z_]+)/([0-9]+)/([a-zA-Z_]+)/([a-zA-Z]+)/([0-9a-zA-Z_-]+(\.(jpg|jpeg|png|gif))) api.php?&category=$1&id=$2&type=$3&size=$4&file=$5 [NC,QSA]