[OPNWAF] Per virtual server option: redirect non-www to www

オープン
#5,932 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
backend, web-dev

調査の方向性

Start by locating the OPNWAF virtual server modal and the code that generates gateway_vhost.conf; the issue names the existing RewriteRule and the desired behavior. Trace how virtual server options reach the generated configuration, then check the relevant plugin tests or validation path. Done when the per-server checkbox produces the requested single redirect when enabled and preserves the current rule when disabled.

索引モデルが issue の本文から書いたものです。

説明

support

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.

If the "HTTP to HTTPS" option is enabled, the OPNWAF plugin redirects http://example.com to https://example.com, but not to the canonical https://www.example.com. The non-www to www redirect currently has to be done by the web server itself (e.g. via .htaccess), resulting in two consecutive redirects before reaching the canonical host.

Describe the solution you'd like

A per-virtual-server checkbox in the virtual server modal: "Redirect non-www to www". When enabled, requests to http://example.com should be redirected in a single redirect to https://www.example.com.

In the generated gateway_vhost.conf, the virtual host currently contains:

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

With the option enabled it should instead contain:

RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Describe alternatives you've considered

Handling the non-www to www redirect from the web server itself via .htaccess, which works but requires a second redirect and moves canonicalization away from the edge.

Additional context

None.

主要言語
PHP
スター
1.2k
フォーク
926
平均マージ
1日 10時間
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

opnsense/plugins のほかの issue

opnsense/plugins の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。