Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:21:47+00:00 2026-06-02T17:21:47+00:00

I have a rewrite rule which is looking for a particular URI. When it

  • 0

I have a rewrite rule which is looking for a particular URI. When it matches the particular URL it rewrites it with a proper file path so the required content can be found. It then changes the protocol to HTTPS and allows the request to pass through.

I have two problems;

  1. I don’t want the rewritten path to appear in the users browser – i want to maintain the vanity url
  2. I do want the HTTPS protocol to appear indicating to the user that they are accessing the site over a secured conection.

I have tried a couple of options but no success. If i include the [R] flag the URL and protocol remain unchanged but that is not the desired effect

Any suggestions on how i can achieve this?

This is my rule;

RewriteMap redirectsIfSecure txt:/myserver/content/secure_urls.txt
RewriteCond ${lowercase:%{REQUEST_URI}} ^/(.+)$
RewriteCond ${redirectsIfSecure:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^(.*)$ https://myserver.com${redirectsIfSecure:%1} [PT]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:21:50+00:00Added an answer on June 2, 2026 at 5:21 pm

    From the mod_rewrite documentation:

    If an absolute URL is specified, mod_rewrite checks to see whether the
    hostname matches the current host. If it does, the scheme and hostname
    are stripped out and the resulting path is treated as a URL-path.
    Otherwise, an external redirect is performed for the given URL. To
    force an external redirect back to the current host, see the [R] flag
    below.

    If you rewrite the request to a fully qualified URL (that is, anything starting with http://, https://, etc) that doesn’t match your ServerName, then mod_rewrite will issue an HTTP redirect, which will cause the client browser to request the resource from the new location.

    If you’re not trying to switch between http and https you can use a proxy rule (the P flag) to have Apache make the request on behalf of the client and return the result, thus masking the rewritten URL.

    However, if you’re trying to upgrade from http to https (or the other way around), this will always require a client redirect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following rewrite rule: <rewrite url=^/Membership/(.+)/(.+)/(.+)/(.+) to=/Membership/Index.aspx?parentf=$3&amp;f=$4/> which I am expecting should
I have this rewrite rule RewriteEngine On RewriteBase /location/ RewriteRule ^(.+)/?$ index.php?franchise=$1 Which is
I have this rewrite rule in my .htaccess file, but in PHP when I
I have the following rewrite rule rewrite ^/ab(.*)/(.*)$ /repo/ab$1/rtest/$2 break; When the request file
I have a really simple mod-rewrite rule : RewriteRule ^(.*)$ index.php?url=$1 [PT,L] As an
I am stuck trying to write a rewrite rule for my htaccess file which
I need to return a url from a rewrite rule which contains either a
I have rewrite rule which works on subdomain other than www. I want to
In my lighttpd config file, I have a rewrite rule like this: $HTTP[host] ==
I have a mod rewrite rule for pagination of my content: RewriteRule ^content/page/([^/]*)$ /index.php?page=$1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.