[英]How to remove index.php and picture.php from Piwigo?
https://example.com/index.php/categories
在url index.php上看起来不太好。 如何从网址中删除index.php?
https://example.com/picture.php?/246/category/red-color-women-shoes
"picture.php?"
-想要删除友好的网址/246/
-不知道它是什么。 /category/
-我认为它应该是类别名称,但显示“ category”
Piwigo是用于Web的开源照相馆软件https://piwigo.org/
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]
如果我理解您的问题是对的..希望对您有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.