{"id":4909,"date":"2026-08-29T22:30:34","date_gmt":"2026-08-29T13:30:34","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/configure-redirects-with-openlitespeed-2\/"},"modified":"2026-08-29T22:30:35","modified_gmt":"2026-08-29T13:30:35","slug":"configure-redirects-with-openlitespeed","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/wordpress-blog-seo\/configure-redirects-with-openlitespeed\/","title":{"rendered":"How to Configure Redirects (Rewrite Rules) in OpenLiteSpeed"},"content":{"rendered":"<p>Since Google AdSense did not allow direct registration of a subdomain (donguri3.net), I needed to redirect traffic from donguri3.net to donguri3.net in order to pass the Google AdSense review. Therefore, I decided to handle this by setting up a redirect from the root domain.<\/p>\n<h2>Environment<\/h2>\n<ul>\n<li><strong>Web Server:<\/strong> OpenLiteSpeed<\/li>\n<li><strong>Container:<\/strong> <a href=\"https:\/\/github.com\/litespeedtech\/ols-docker-env\"><code>ols-docker-env<\/code><\/a><\/li>\n<li><strong>Configuration Location:<\/strong> The <code>rewrite<\/code> tab under <code>docker<\/code> in <code>VHost Templates<\/code><\/li>\n<\/ul>\n<h2>Configuration Steps<\/h2>\n<h3>Adding Rewrite Rules<\/h3>\n<p>Access the OpenLiteSpeed administration screen and follow the steps below to configure the settings.<\/p>\n<ol>\n<li>Open <code>Virtual Hosts<\/code> \u2192 <code>VHost Templates<\/code> \u2192 <code>docker<\/code><\/li>\n<\/ol>\n<p><a href=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_166_192.168.232.33.jpeg\"><img decoding=\"async\" class=\"aligncenter wp-image-400 size-large\" src=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_166_192.168.232.33-1024x231.jpeg\" alt=\"Rewrite rules in OpenLiteSpeed\" width=\"1024\" height=\"231\" srcset=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_166_192.168.232.33-1024x231.jpeg 1024w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_166_192.168.232.33-300x68.jpeg 300w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_166_192.168.232.33-768x173.jpeg 768w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_166_192.168.232.33.jpeg 1422w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<ol start=\"2\">\n<li>Select the <code>Rewrite<\/code> tab<\/li>\n<li>Set <code>Enable Rewrite<\/code> to <code>Yes<\/code><\/li>\n<li>Enter the following content in <code>Rewrite Rules<\/code><\/li>\n<\/ol>\n<blockquote>\n<p>RewriteCond %{http_host} ^donguri3.net<br \/>\nRewriteRule ^(.*) https:\/\/donguri3.net\/$1 [R=301,L]<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_1623_192.168.232.33.jpeg\"><img decoding=\"async\" class=\"aligncenter wp-image-399 size-large\" src=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_1623_192.168.232.33-1024x389.jpeg\" alt=\"Rewrite rules in OpenLiteSpeed\" width=\"1024\" height=\"389\" srcset=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_1623_192.168.232.33-1024x389.jpeg 1024w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_1623_192.168.232.33-300x114.jpeg 300w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_1623_192.168.232.33-768x292.jpeg 768w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_15-2-2025_1623_192.168.232.33.jpeg 1418w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<ol start=\"5\">\n<li>Click <code>Save<\/code> to apply the settings<\/li>\n<li>Perform a <code>Graceful Restart<\/code><\/li>\n<\/ol>\n<h3>Verifying the Configuration<\/h3>\n<p>To verify that the settings have been applied correctly, access <code>http:\/\/donguri3.net<\/code> in your browser and confirm that it redirects to <code>https:\/\/donguri3.net<\/code>.<\/p>\n<p>You can also run the following command to check if the redirect is working properly.<\/p>\n<pre><code>curl -I http:\/\/donguri3.net<\/code><\/pre>\n<p>If the response includes <code>301 Moved Permanently<\/code>, the configuration is successful.<\/p>\n<pre><code>HTTP\/1.1 301 Moved Permanently\nLocation: https:\/\/donguri3.net\/<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>With this configuration, I was able to successfully redirect traffic from <code>donguri3.net<\/code> to <code>donguri3.net<\/code>. Setting up proper redirects is essential for passing the Google AdSense review. OpenLiteSpeed makes it easy to configure redirects by utilizing <code>Rewrite Rules<\/code>, so if you are facing a similar issue, give it a try.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since Google AdSense did not allow direct registration of a subdomain (donguri3.net), I needed to redirect tra [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":1094,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=398","footnotes":""},"categories":[1166],"tags":[18,19,86,15,13,14,91,10],"class_list":["post-4909","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-blog-seo","tag-docker","tag-docker-compose","tag-google-adsense","tag-litespeed","tag-ols","tag-openlitespeed","tag-seo","tag-server","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=4909"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4909\/revisions"}],"predecessor-version":[{"id":4912,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4909\/revisions\/4912"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/1094"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=4909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=4909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=4909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}