• 0

Help with Domain Name and IP Redirection


Question

Can someone help me with redirecting a domain name to the HTTPS version of itself?  I've seen many examples online but none of them seems to fit my specific requirements.

 

I think I need multiple "if" conditions that will redirect any non-"https://www" queries to the "https://www" version of itself.

 

Below is the 301 redirection options I need to include in the .htaccess file:

 

 Routing-Table.thumb.png.d04f63ab7358df43c6012f2427c04c10.png

 

From the above table, you'll notice that I need at least 3 condition checks within my single .htaccess file. Also, as I'm using the same .htaccess file in my localhost as well as on my public web site, the "if" conditions will also need to accommodate localhost as well.

 

I can only test for either A, B or C from the list above.  I can't test a combination of all of them.

 

Please can a kind Neowin expert assist me?

 

Thank you.

 

 

9 answers to this question

Recommended Posts

  • 0

Why would the standard redirect all to https not work?

 


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

 

Why would you be using local host and not just use fqdn www.test.com that resolve to your local IP your site is listening on?  Be simple host file on your local machine for that matter.

 

You should be able to replace the variables with the exact fqdn you want to use https://www.test.com

  • 0

There is a actual "table", in my post (click here to see it), it illustrates the place the user start at and where I want them to end at (a "route").

 

So if a user tries "test.com",  they end up at "https://www.test.com",

If a user tries "www.test.com",  they end up at "https://www.test.com",

If a user tries "https://test.com",  they end up at "https://www.test.com",

If a user tries "255.255.255.255",  they end up at "https://www.test.com",

And also,

If a user tries "localhost",  they end up at "https://localhost".

If a user tries "brianpc",  they end up at "https://brianpc".

If a user tries "192.186.0.100",  they end up at "https://brianpc".

 

Original question was too confusing.  I hope you can help.

Thank you.

  • 0

Thanks Bud but you didn't exact answer the question. Redirecting https to https is easy but my questions was not to redirect http > https; it was to redirect multiple states of the URL to https://www.  So the actual question remains unanswered.  If it helps you, read this message, and see if you actually answered my question or not.

  • 0
45 minutes ago, Brian Miller said:

it was to redirect multiple states of the URL to https://www.

Dude yes the information redirects whatever they send to that via https, you can just edit it to go www.something.com

 

This is not all that difficult...  Here.. Lets go through it line by line

 

A,B and C - YES

D - Again yes..

EFG - Yes once again... But Freaking why??  Are you too freaking lazy to just go to https://www.domain.tld

 

And have that resolve to whatever your localhost box IP is? via simple entry in your host file on your host or via your dns you run on your network.  But to be honest your running Apache you should just do it via a redirect in your conf

 

http://httpd.apache.org/docs/current/rewrite/avoid.html#redirect

<VirtualHost *:80>
    ServerName www.example.com
    Redirect / https://www.example.com/
</VirtualHost>

<VirtualHost *:443>
    ServerName www.example.com
    # ... SSL configuration goes here
</VirtualHost>

 

Also if you want your using to use https you should really be setting up HSTS..

This topic is now closed to further replies.
  • Posts

    • Google Chrome 149.0.7827.156 (offline installer) by Razvan Serea The web browser is arguably the most important piece of software on your computer. You spend much of your time online inside a browser: when you search, chat, email, shop, bank, read the news, and watch videos online, you often do all this using a browser. Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. Use one box for everything--type in the address bar and get suggestions for both search and Web pages. Thumbnails of your top sites let you access your favorite pages instantly with lightning speed from any new tab. Desktop shortcuts allow you to launch your favorite Web apps straight from your desktop. Chrome has many useful features built in, including automatic full-page translation and access to thousands of apps, extensions, and themes from the Chrome Web Store. Google Chrome is one of the best solutions for Internet browsing giving you high level of security, speed and great features. This update includes 33 security fixes. [N/A][516496659] Critical CVE-2026-12437: Use after free in WebShare. Reported by Google on 2026-05-25 [N/A][516947912] Critical CVE-2026-12438: Inappropriate implementation in WebView. Reported by Google on 2026-05-27 [N/A][519728275] Critical CVE-2026-12439: Use after free in Digital Credentials. Reported by Google on 2026-06-03 [N/A][519731619] Critical CVE-2026-12440: Use after free in DigitalCredentials. Reported by Google on 2026-06-03 [N/A][520157118] Critical CVE-2026-12441: Use after free in File Input. Reported by Google on 2026-06-05 [N/A][521950423] Critical CVE-2026-12442: Use after free in Passwords. Reported by Google on 2026-06-09 [N/A][522566295] Critical CVE-2026-12443: Use after free in Web Authentication. Reported by Google on 2026-06-11 [N/A][513160088] High CVE-2026-12444: Out of bounds read in Chromoting. Reported by Google on 2026-05-14 [N/A][513199795] High CVE-2026-12445: Use after free in Extensions. Reported by Google on 2026-05-14 [N/A][513313107] High CVE-2026-12446: Insufficient data validation in Passwords. Reported by Google on 2026-05-14 [N/A][513405023] High CVE-2026-12447: Heap buffer overflow in WebRTC. Reported by Google on 2026-05-15 [N/A][513458233] High CVE-2026-12448: Inappropriate implementation in WebView. Reported by Google on 2026-05-15 [N/A][513480539] High CVE-2026-12449: Use after free in Chromoting. Reported by Google on 2026-05-15 [N/A][514531776] High CVE-2026-12450: Inappropriate implementation in Media. Reported by Zhixin Tu on 2026-05-19 [N/A][514741076] High CVE-2026-12451: Use after free in DigitalCredentials. Reported by Google on 2026-05-19 [N/A][515462244] High CVE-2026-12452: Use after free in Downloads. Reported by Google on 2026-05-21 [N/A][516448843] High CVE-2026-12453: Insufficient validation of untrusted input in Input. Reported by Google on 2026-05-25 [N/A][516926968] High CVE-2026-12454: Race in Safe Browsing. Reported by Google on 2026-05-27 [N/A][517069848] High CVE-2026-12455: Use after free in Tab Strip. Reported by Google on 2026-05-27 [N/A][517124587] High CVE-2026-12456: Insufficient validation of untrusted input in Extensions. Reported by Google on 2026-05-27 [N/A][517153117] High CVE-2026-12457: Insufficient data validation in Extensions. Reported by Google on 2026-05-27 [N/A][517258337] High CVE-2026-12458: Incorrect security UI in Passwords. Reported by Google on 2026-05-27 [N/A][517406035] High CVE-2026-12459: Inappropriate implementation in Serial. Reported by Google on 2026-05-28 [N/A][517484284] High CVE-2026-12460: Insufficient policy enforcement in File System Access. Reported by Google on 2026-05-28 [N/A][517727318] High CVE-2026-12461: Out of bounds read in WebRTC. Reported by Google on 2026-05-29 [N/A][517916024] High CVE-2026-12462: Use after free in Media. Reported by Google on 2026-05-29 [N/A][518042749] High CVE-2026-12463: Inappropriate implementation in Views. Reported by Google on 2026-05-30 [N/A][519358344] High CVE-2026-12464: Use after free in Browser. Reported by Google on 2026-06-03 [N/A][520189702] High CVE-2026-12465: Insufficient validation of untrusted input in Metrics. Reported by Google on 2026-06-05 [N/A][520199394] High CVE-2026-12466: Heap buffer overflow in WebRTC. Reported by Google on 2026-06-05 [N/A][520202726] High CVE-2026-12467: Use after free in Extensions. Reported by Google on 2026-06-05 [N/A][521485244] High CVE-2026-12468: Inappropriate implementation in Updater. Reported by Google on 2026-06-08 [N/A][521618871] High CVE-2026-12469: Uninitialized Use in GPU. Reported by Google on 2026-06-09 Important to know! The offline installer links do not include the automatic update feature. Download web installer: Google Chrome Web 32-bit | Google Chrome 64-bit | Freeware Download: Google Chrome Offline Installer 64-bit | Direct Link | 131.0 MB Download: Google Chrome Offline Installer 32-bit | Direct Link | 119.0 MB Download page: Google Chrome Portable Download: Chrome ARM64 | Direct Link View: Chrome Website | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • they couldnt do W11 LTSC so the support lasts longer....
    • The fact that the pref is not enabled by default tells you that what you see is what you get...for now. Hopefully the final version will have all the quirks ironed out.
    • It's enterprise, not consumer. And "...affected scenarios involve third-party software..." Would be good to know that in headline, not way down in the article. Instead, you lead with Windows update, which is not very helpful and misleading, IMHO. Just saying.
  • Recent Achievements

    • Week One Done
      suprememobiles48 earned a badge
      Week One Done
    • One Month Later
      Windows Guy earned a badge
      One Month Later
    • One Month Later
      Prasann earned a badge
      One Month Later
    • Week One Done
      Prasann earned a badge
      Week One Done
    • First Post
      Dys Topia earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      503
    2. 2
      +Edouard
      173
    3. 3
      PsYcHoKiLLa
      97
    4. 4
      Steven P.
      85
    5. 5
      ATLien_0
      71
  • Tell a friend

    Love Neowin? Tell a friend!