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 9284181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:50:19+00:00 2026-06-18T18:50:19+00:00

I am an Apache noob and am trying to automatically redirect requests for http://.com/gitweb

  • 0

I am an Apache noob and am trying to automatically redirect requests for http://.com/gitweb to https://.com/gitweb

I’ve set the following to /etc/apache2/conf.d/gitweb

Alias /gitweb /usr/share/gitweb
<Directory /usr/share/gitweb>
  Options FollowSymLinks +ExecCGI
  AddHandler cgi-script .cgi
  Redirect gitweb https://<myserver>.com/gitweb
  SSLRequireSSL
</Directory>

However I just keep getting the 403 forbidden notice

Forbidden
You don't have permission to access /gitweb on this server.
Apache/2.2.22 (Ubuntu) Server at dndo-gamma Port 80

I don’t want all directories hosted by this server to redirect; just the request for gitweb.

My /etc/apache2/sites-enabled/000-default is unchanged from its default

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
       Options Indexes MultiViews FollowSymLinks
       AllowOverride None
       Order deny,allow
       Deny from all
       Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

The file /etc/apache2/sites-enabled/default-ssl is also unchanged from default ubuntu/apache2 installation.

  • 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-18T18:50:21+00:00Added an answer on June 18, 2026 at 6:50 pm

    usually i use mod_rewrite for these kind of tasks:

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteLog "/var/log/apache2/rewrite_log"
    
        RewriteRule ^/gitweb/(.*) https://%{SERVER_NAME}/gitweb/%1 [R]
    

    but this is not programming but server-configuration; you might consider asking this question on serverfault.com

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

Sidebar

Related Questions

I have done everything said on the following page. https://help.ubuntu.com/community/Django but it gives me
Apache: How redirect from domain.com to www.domain.com? I dont want my users who type
Apache webserver setup added: AddType application/x-mpegURL .m3u8 AddType video/MP2T .ts to httpd.conf file. Movie
Apache lets you set php.ini values for virtual hosts with the php_value directive. Does
Using Apache's RewriteRule, how can I make it serve: mydomain.com/webpage.php?name=home_page as simply: mydomain.com/ Without
Apache Wicket ( http://wicket.apache.org/ ) and Apache Tapestry ( http://wicket.apache.org/ ) are both component
Apache Http Client. You can see the relevant code here : String url =
Consider the following: RewriteRule ^(.*)$ index.php/$1 Based on the fledgling noob knowledge I have
Noob at javascript etc. here. I’m a php/core Java programmer tasked with maintaining a
the Apache guide on Http connections mention that The overhead of connection handshaking can

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.