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

  • Home
  • SEARCH
  • 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 7165817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:18:47+00:00 2026-05-28T14:18:47+00:00

I am trying to do forward all incoming requests to https, except if the

  • 0

I am trying to do forward all incoming requests to https, except if the url contains /axis2 (http://locatlhost/axis2) in URL. This is what I have written (in my httpd.conf file):

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/axis2$ [NC]
RewriteRule $ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]

This is not working and I am unable to debug why. Can anyone help me.

  • 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-05-28T14:18:47+00:00Added an answer on May 28, 2026 at 2:18 pm

    Have you set up a separate VirtualHost for port 443?

    if yes try removing the __default__ from the VirtualHost directive in your ssl.conf / VirtualHost directive set by ssl.

    Which should look like this:

    <VirtualHost _default_:443>
    

    First of all I would suggest you to add this in your VirtualHost. To log the activities or mod_rewrite. It Will be helpful for debugging and higher the RewriteLogLevel better for debugging.

    RewriteEngine On
    RewriteLog "/path/to/your/rewrite.log"
    RewriteLogLevel 3
    

    From RewriteLogLevel Docs:

    To disable the logging of rewriting actions simply set Level to 0. This disables all rewrite action logs.
    Using a high value for Level will slow down your Apache server dramatically! Use the rewriting logfile at a Level greater than 2 only for debugging!


    Try this for your issue:

    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/?axis2/(?:.*)$ [NC]
    RewriteRule ^(.*)(/?axis2/)(.*)$ https://$1$2$3 [L,R=301]
    RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI}%{QUERY_STRING} [L,QSA,R=301]
    

    If the %{REQUEST_URI} does not start and end with /axis2 or axis2/ or/axis2/ or axis2 it will redirect your URIs to https and stop any further rule rewriting.

    Else, only this will execute:

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

    R=301 means a permanent redirection. If just R is specified, a temporary redirect i.e. 302 will be done.

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

Sidebar

Related Questions

I am trying to create a HttpServlet that forwards all incoming requests as is,
I've been banging my head all day trying to fix this. I have a
I am trying to forward a keyboard event from the Collection View to all
I am new to mod_rewrite. I am trying to forward a URL to another
Trying to keep all the presentation stuff in the xhtml on this project and
I use mod_rewrite/.htaccess for pretty URLs. I forward all the requests to my index.php,
I'm trying to delete all calendar entries from today forward. I run a query
In the apache server installation I have a .conf file which forwards all requests
I'm trying to redirect all requests to my domain to another domain using mod_rewrite
This should be straight forward for a guru. I don't have any code really

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.