Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/229.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
如何从Piwigo中删除index.php和picture.php?_Php_.htaccess_Url_Configuration - Fatal编程技术网

如何从Piwigo中删除index.php和picture.php?

如何从Piwigo中删除index.php和picture.php?,php,.htaccess,url,configuration,Php,.htaccess,Url,Configuration,在url index.php上,它看起来不太好。如何从url中删除index.php https://example.com/index.php/categories “picture.php?”-要删除友好url吗 /246/-不确定它是什么。 /category/-我认为应该是category名称,但显示“category” Piwigo是一款面向web的开源照片库软件 Url应该是 https://example.com/index.php/categories https://exa

在url index.php上,它看起来不太好。如何从url中删除index.php

https://example.com/index.php/categories
“picture.php?”
-要删除友好url吗
/246/
-不确定它是什么。
/category/
-我认为应该是category名称,但显示“category”

Piwigo是一款面向web的开源照片库软件

Url应该是

https://example.com/index.php/categories
https://example.com/picture.php?/246/category/red-color-women-shoes

$conf['question_mark_in_urls'] = false;
$conf['php_extension_in_urls'] = false; // this does not work
$conf['category_url_style'] = 'id-name';
$conf['picture_url_style'] = 'file';

如果我没弄错你的问题。。希望有帮助


如果我没弄错你的问题。。希望这有帮助

非常感谢您的回答。看来你已经非常接近解决方案了。非常感谢你的回答。看来你已经非常接近解决方案了。
https://example.com/index.php/categories
https://example.com/picture.php?/246/category/red-color-women-shoes

$conf['question_mark_in_urls'] = false;
$conf['php_extension_in_urls'] = false; // this does not work
$conf['category_url_style'] = 'id-name';
$conf['picture_url_style'] = 'file';
https://example.com/categories
https://example.com/category-name/red-color-women-shoes
#TURN ON REWRITES
RewriteEngine on
RewriteBase /

#THEN OPTIONALLY MAKE IT www if they didnt enter it
RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$ [NC]
RewriteRule ^(.*) https://www.example.com/$1 [R=301,L]

#Write index.any to /
RewriteRule ^index\.[a-z]{2,3}     /     [L,R=301]

#THEN REWRITE LOCATIONS
RewriteRule ^([0-9]+)/category/(.*)$    picture.php?id=$1&page_url=$2   [L]
#IF CATEGORY IS ALSO DYNAMIC THEN TRY THIS FOR REWRITE
RewriteRule ^([0-9]+)/(.*)/(.*)$    picture.php?id=$1&category=$2&page_url=$3   [L]