Dernière mise à jour : 27/08/2017 à 21h35
Vous êtes sous nginx et votre réécriture des urls pour PHPBoost ne fonctionne pas ? C'est tout à faire normal, nginx ne gère pas les .htaccess, vous êtes obligé de passer par la configuration de nginx.
- Éditez votre virtual host ou votre fichier nginx.conf.
- Insérez s'y le code de réécriture des URLs après la ligne server_name :
rewrite "^/user/pm-?([0-9]+)-?([0-9]{0,})-?([0-9]{0,})-?([0-9]{0,})-?([a-z_]{0,})\.php$" /user/pm.php?pm=$1&id=$2&p=$3"e=$4 last;
rewrite ^/admin/config/([\w/_-]*)$ /admin/config/index.php?url=/$1 last;
rewrite ^/admin/cache/([\w/_-]*)$ /admin/cache/index.php?url=/$1 last;
rewrite ^/admin/errors/([\w/_-]*)$ /admin/errors/index.php?url=/$1 last;
rewrite ^/admin/themes/([\w/_-]*)$ /admin/themes/index.php?url=/$1 last;
rewrite ^/admin/langs/([\w/_-]*)$ /admin/langs/index.php?url=/$1 last;
rewrite ^/admin/modules/([\w/_-]*)$ /admin/modules/index.php?url=/$1 last;
rewrite ^/admin/member/([\w/_-]*)$ /admin/member/index.php?url=/$1 last;
rewrite ^/admin/content/([\w/_-]*)$ /admin/content/index.php?url=/$1 last;
rewrite ^/syndication/([\w/_-]*)$ /syndication/index.php?url=/$1 last;
rewrite ^/user/([\w/-_]*)$ /user/index.php?url=/$1 last;
rewrite ^/QuestionCaptcha/([\w/_-]*)$ /QuestionCaptcha/index.php?url=/$1 last;
rewrite ^/articles/([\w/_-]*)$ /articles/index.php?url=/$1 last;
rewrite ^/calendar/([\w/_-]*)$ /calendar/index.php?url=/$1 last;
rewrite ^/faq/faq-([0-9]+)(\+?[^.]*)\.php(\?question=([0-9]+))?$ /faq/faq.php?id=$1&id_question=$3 last;
rewrite ^/guestbook/([\w/_-]*)$ /guestbook/index.php?url=/$1 last;
rewrite ^/news/([\w/_-]*)$ /news/index.php?url=/$1 last;
rewrite ^/newsletter/([\w/_-]*)$ /newsletter/index.php?url=/$1 last;
rewrite ^/online/([\w/_-]*)$ /online/index.php?url=/$1 last;
rewrite ^/poll/poll-([0-9]+)-?([0-9]*)-?([0-9]*)\.php$ /poll/poll.php?id=$1&r=$2&p=$3 last;
rewrite ^/sitemap/([\w/_-]*)$ /sitemap/index.php?url=/$1 last;
rewrite ^/stats/stats-([a-z]+)\.php$ /stats/stats.php/$1=1 last;
rewrite ^/wiki/([a-z0-9-]+)$ /wiki/wiki.php?title=$1 ;
rewrite ^/customization/([\w/_-]*(?:\.css)?)$ /customization/index.php?url=/$1 last;
rewrite ^/dictionary/dictionary-([0-9a-z]+)-?([0-9]*)(\+?[^.]*)\.php$ /dictionary/dictionary.php?l=$2&cat=$3 last;
if ($http_referer !~ "^$"){
set $rule_25 1$rule_25;
}
if ($http_referer !~ "^http://creapoint.cf"){
set $rule_25 2$rule_25;
}
if ($rule_25 = "21"){
break;
}
if ($http_user_agent ~* "libwww"){
set $rule_26 1;
}
if ($rule_26 = "1"){
break;
}
error_page 403 /user/error/403/;
error_page 404 /user/error/404/;
expires 604800s;
location ~* \.(jpeg|jpg)$ {
expires 2592000s;
}
location ~* \.(png)$ {
expires 2592000s;
}
location ~* \.(gif)$ {
expires 2592000s;
}
location ~* \.(ico)$ {
expires 2592000s;
}
location ~* \.(css)$ {
expires 2592000s;
}
location ~* \.(js|jsonp)$ {
expires 2592000s;
}
location ~* \.(js)$ {
expires 2592000s;
}
location ~* \.(swf)$ {
expires 2592000s;
} - Sauvegardez le fichier.
- Relancez nginx : sudo service nginx restart.