Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Set Up Domain Redirects in Webmin and Virtualmin

A practical guide to creating and verifying domain redirects in Virtualmin, Webmin's Apache module, and the Virtualmin CLI, with status-code guidance, regex examples, DNS requirements, and loop troubleshooting.
WorldWebmin and Virtualmin Length12 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set up the redirect in the web server after the domain resolves to your server. In Virtualmin, choose the domain, open Web Configuration → Website Redirects, enter the source path and destination, and save. In Webmin, use Servers → Apache Webserver → Aliases and Redirects, save the rule, then click Apply Changes. Choose HTTP status 301 for a permanent move, 302 for a temporary move, or 303 when you specifically need replacement-style semantics. Verify the result with curl -I and inspect the Location header.

How domain redirects work

A redirect is an HTTP response generated by the web server that answers a request for one URL with a status code and a Location header pointing to another URL. DNS does not perform the redirect. DNS only sends the source hostname to the server; Apache or another configured web server then decides which virtual host handles the request and returns the redirect.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That separation explains many failed setups. A perfectly configured rule is unreachable when the domain is not registered, its DNS records point elsewhere, or the request is landing on a different virtual server. Conversely, a hostname can resolve correctly while still returning the wrong status, selecting the wrong site, or looping between HTTP and HTTPS rules.

Prerequisites before creating a rule

  • The source domain or subdomain is registered and its DNS records resolve to the server that hosts the virtual server.
  • The source name is configured as a virtual server in Virtualmin or Apache Webmin. A redirect rule attached to another virtual server will not answer the intended request.
  • Apache is available when you use Webmin’s Apache Webserver module. Virtualmin installations can use Apache or Nginx, but the menu names and rule mechanisms are web-server specific.
  • HTTPS is planned for the source hostname. If you intend to test https://source.example, the server must be able to complete TLS before it can return an HTTP redirect.
  • You have permission to edit the selected virtual server and reload its generated configuration.

Confirm DNS and virtual-host selection first. A quick check from a client is dig +short source.example or an equivalent DNS lookup. The returned address should be the server on which the source virtual server is configured. DNS changes can remain cached according to the record’s TTL, so test from a network that is actually resolving the intended address.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Choose the setup method

Method Best for Important action Default status
Virtualmin Website Redirects One-off redirects managed per domain Save the redirect in the selected domain’s Web Configuration area Use the status offered by the form; choose 301 when the move is permanent
Webmin Apache Webserver Apache virtual-server administration and server-wide rules Click Apply Changes after saving 302 for a normal URL redirect
Virtualmin command line Repeatable changes, scripts, and bulk operations Run virtualmin create-redirect for the correct domain and path 302 when --code is omitted

Use a per-virtual-server rule unless every site on the server should receive the same redirect. In Webmin, the Default Server entry applies globally; selecting a named virtual server limits the rule to that host.

Set up a redirect in Virtualmin

Virtualmin’s graphical workflow is the shortest route for a redirect that belongs to one domain.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Sign in to Virtualmin and select the source domain from the domain selector. Select the domain that receives the old URL, not the destination domain.
  2. Open Web Configuration for that domain.
  3. Select Website Redirects.
  4. Create a redirect by entering the source path and destination URL. A source path normally begins with a slash, such as /old-page. Use a complete destination such as https://new.example/new-page when sending visitors to another host.
  5. Choose the appropriate redirect behavior offered by the form, then save the change.
  6. Request the exact source URL and inspect both the response status and the final destination. Use a browser’s network panel or run curl -I https://source.example/old-page.

For a site move, enter the destination host explicitly rather than assuming the panel will reconstruct it. For a path move within the same host, use the new absolute path or full URL that you want clients to receive. Test a URL with a trailing slash separately when your old and new paths differ by slash handling.

Set up a redirect in Webmin’s Apache module

Webmin’s Apache procedure edits the selected Apache virtual server through its form controls. It does not become active until Apache is reloaded through the interface.

  1. Open Webmin → Servers → Apache Webserver.
  2. Select the virtual server that owns the source domain. Select Default Server only if the rule is intentionally global.
  3. Open Aliases and Redirects.
  4. In URL redirects, enter the source URL path in From and the destination in To. Add an HTTP status if the form provides that option.
  5. Save the form.
  6. Click Apply Changes at the top of the Apache Webserver page. This reloads the generated Apache configuration so the rule can answer requests.

A normal URL redirect in Webmin uses HTTP 302 unless you select another status. The module also exposes separate Permanent URL redirects, which always use 301, and Temporary URL redirects, which use 302. Use one style consistently for a given source path; overlapping entries can make the effective rule difficult to predict.

Choose the correct HTTP status

Status Meaning in this setup When to use it Operational consequence
301 Permanent redirect The old URL has moved permanently and the destination should be treated as the replacement Clients and search systems can retain the destination as the canonical location; changing it later may be slower to observe because clients can cache permanent responses
302 Temporary redirect The destination may change back or the move is being tested Signals that the source should remain the primary location
303 See-other or replacement-style response A client should retrieve the destination as a separate resource after the original request Useful for replacement-style flows rather than an ordinary permanent site move

Webmin documents 302 as the normal redirect default, 301 for a permanent redirect, and 303 for replacement-style semantics. Virtualmin’s command-line interface also defaults to 302 when --code is not supplied. Do not choose 301 merely because it is common: use it when the old address is genuinely replaced.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Redirect one path to another

A simple path rule is appropriate when the old and new URLs are known and no suffix needs to be preserved.

  • From: /old-page
  • To: https://example.com/new-page
  • Status: 301 for a permanent move, or 302 while testing

The source is a local path on the selected virtual server. The destination can be a path on the same host or a URL on another host. Always include the scheme and hostname when redirecting between domains so that the response is unambiguous.

If you want every URL under a directory to land on one fixed page, create a rule that targets that directory intentionally. Do not assume a simple /old-section entry will preserve arbitrary child paths; preservation requires a regular-expression rule or an equivalent path-mapping feature.

Redirect a group of URLs with a regular expression

Use a regex rule when part of the original path must be captured and inserted into the destination. In Webmin, open Regexp URL redirects. A documented example is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
From: ^/webmin/(.*)$
To:   https://webmin.com/$1

Here, ^ anchors the match at the beginning of the path, /webmin/ identifies the directory, (.*) captures the remainder, and $1 inserts that captured remainder into the destination. A request such as /webmin/help therefore targets https://webmin.com/help.

  • Keep the anchors when the rule is intended to cover the complete path rather than a substring.
  • Check the capture number. The first parenthesized group is $1; additional groups use $2, $3, and so on.
  • Test a path with text, a path with several slash-separated segments, and a path that should not match.
  • Be deliberate about a trailing slash. A pattern ending in / does not match the same way as one that permits an optional slash.

Regex rules are more powerful but easier to overmatch. A broad expression can intercept administrative paths, assets, or the destination itself and create a loop. Start with the narrowest expression that satisfies the migration, then test outside the intended directory.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Use Virtualmin’s command line

Virtualmin provides a documented create-redirect command for automation and repeatable changes:

virtualmin create-redirect --domain domain.name 
  --path /old-path 
  --redirect https://new.example/target 
  --code 301

Replace the domain, path, destination, and status with the values for your virtual server. The command creates a redirect on the virtual server identified by --domain; it does not discover the correct domain from the destination URL.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Option Purpose
--domain domain.name Selects the virtual server where the redirect is created
--path /old-path Sets the local URL path that receives the request
--redirect https://new.example/target Sets a URL or path destination
--code 301 Sets a custom HTTP status; omit it only when the documented 302 default is wanted
--alias /directory Maps to a directory rather than using a redirect URL
--exact Limits matching to the specified path
--regexp Enables regular-expression matching
--http Restricts the rule to HTTP requests
--https Restricts the rule to HTTPS requests

Use --exact when only one path should match. Use --regexp when you need captures or a family of paths. If neither protocol restriction is appropriate, test both schemes after the rule is active. When a script creates several rules, keep the source paths distinct and record the intended status and protocol scope for each one.

Control protocol and virtual-server scope

HTTP-only and HTTPS-only rules

HTTP and HTTPS are separate request schemes. A rule restricted with --http does not automatically cover HTTPS, and a rule restricted with --https does not automatically cover HTTP. Webmin rules may also be affected by how Apache virtual hosts are defined for each scheme. Test both URLs when the source is publicly reachable through both.

A common migration pattern is an HTTP-to-HTTPS redirect followed by a path redirect. Keep the layers ordered and make sure the destination is not sent back to the source. If another virtual host, reverse proxy, or application also enforces HTTPS, remove duplicate rules or ensure they converge on one destination.

Per-site versus default-server rules

A rule on the selected virtual server is limited to that site’s hostname. A rule on Webmin’s Default Server can affect requests that do not match a more specific virtual host and may have wider consequences than intended. Prefer the named virtual server for a domain migration; reserve the default server for a policy that is deliberately global.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

DNS, certificates, and activation are separate layers

For a request to reach the redirect, the source hostname must first resolve to the server and select the intended virtual host. The HTTP response is generated only after that routing step. Treat the layers in this order:

  1. Registration and DNS: the name exists and its records point clients to the server.
  2. Virtual-host selection: Apache or the configured web server recognizes the source hostname and scheme.
  3. TLS: an HTTPS request can complete certificate negotiation for the source name.
  4. Redirect rule: the selected virtual server returns the intended status and Location.
  5. Destination: the client follows the location and receives the final response.

A redirect cannot fix a DNS record that points to another provider. Likewise, an HTTPS redirect cannot be observed if the source certificate is invalid and the client refuses the TLS connection before sending an HTTP request. Configure DNS and certificates for the source names you expect users to enter, then test each scheme independently.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the response

Inspect headers with curl

Use a HEAD request against the exact source URL:

curl -I https://source.example/old-page

For a correct redirect, look for the expected status line, such as HTTP/1.1 301 or HTTP/2 302, and a Location: header containing the destination. To follow the chain and see the final response, add -L:

curl -I -L https://source.example/old-page

Use the exact scheme and path that a visitor will request. Test a URL with and without a trailing slash when both forms are in use, and test a child path when a regex is intended to preserve suffixes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the browser network panel

Open the browser developer tools, select the Network panel, request the source URL, and inspect the first document request. The first response should show the configured status and destination. If the browser immediately displays the final page, the network entry still reveals whether one redirect or several were followed.

Confirm the change was activated

After editing Apache in Webmin, verify that Apply Changes was clicked. A saved form without that reload leaves the running server on its previous configuration. After a Virtualmin API or command-line change, repeat the request and confirm that the generated virtual-host configuration is active rather than relying on the command’s completion message alone.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Troubleshoot common failures

The source returns the old page or a 404

  • Check that the hostname resolves to the intended server, not an old address or a different proxy.
  • Confirm that you selected the source domain in Virtualmin or the correct named virtual server in Webmin.
  • In Webmin, click Apply Changes after saving.
  • Check whether the request is HTTP or HTTPS and whether the rule is restricted to the other scheme.
  • For a regex rule, test the expression against the exact path and verify anchors and capture groups.

The response has the wrong status

A normal Webmin URL redirect and a Virtualmin command without --code use 302 by default. Select a permanent redirect in the Webmin form or add --code 301 to the command when the move is permanent. Conversely, do not leave a test redirect as 301 if you expect to change it frequently.

The redirect loops

Compare the source and destination character by character, including scheme, hostname, path, and trailing slash. Then inspect every layer that can issue a redirect: the Virtualmin rule, Apache directives, HTTP-to-HTTPS enforcement, a reverse proxy or CDN, and application-level routing. A loop often occurs when one layer sends HTTPS back to HTTP while another sends HTTP to HTTPS, or when a broad regex also matches the destination path. Temporarily test each layer’s response with curl -I and remove the rule that points back toward the source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Only some child paths redirect

A simple path entry matches the path behavior provided by that form; it does not necessarily preserve arbitrary descendants. Use a regex with a capture such as (.*) and insert the corresponding $1 in the destination. Test a direct child, a multi-level child, and a path outside the intended directory so that overmatching is visible.

HTTPS fails before a redirect appears

When a client cannot establish TLS, it never reaches the HTTP redirect handler. Check that the source hostname’s certificate is installed on the HTTPS virtual host and that DNS points to the server holding that certificate. Test the HTTP URL separately to determine whether only the TLS layer is failing.

The rule affects other domains

In Webmin, check whether the rule was added under Default Server rather than the named virtual server. Move a site-specific rule to the correct virtual server and retest another hostname hosted on the machine.

Safe migration checklist

  1. List every old URL that must move and decide whether each destination is fixed or must preserve a path suffix.
  2. Confirm source DNS, virtual-server ownership, and certificates for both HTTP and HTTPS where applicable.
  3. Choose 301 only for confirmed permanent moves; use 302 while a temporary destination is being evaluated.
  4. Create the narrowest per-virtual-server rules first. Use regex only where exact rules cannot express the required mapping.
  5. Apply or activate the generated configuration.
  6. Check each source with curl -I, confirming status and Location.
  7. Follow the redirect with curl -I -L and verify that the final response is not another unintended redirect.
  8. Test both protocols, representative child paths, trailing-slash variants, and a hostname that should not match a site-specific rule.
  9. Document the source, destination, status, protocol scope, and virtual server so a later administrator can remove or revise the rule safely.

Which approach should you use?

Use Virtualmin’s Website Redirects page when one administrator needs to add a small number of rules for a single domain. Use Webmin’s Apache module when you need to inspect Apache virtual servers, choose between a named server and the default server, or manage regex redirects through the Apache interface. Use virtualmin create-redirect when the change must be scripted, repeated, or expressed with explicit options such as --exact, --regexp, --http, or --https.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The reliable sequence is the same in every case: point DNS at the correct server, select the correct virtual host, create the narrowest matching rule, activate the configuration, and verify the actual HTTP status and Location header. Keeping those layers separate prevents most redirect failures and makes loops or wrong-host responses straightforward to isolate.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.