Hi Eric,

For both versions, we have the same config. Below are the end-to-end files.

httpd.conf

#HTTPD.CONF

#TEMPLATE?
ServerName xyz.hostname.com

Listen 1098

LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule remoteip_module modules/mod_remoteip.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so

DocumentRoot "/path/to/docroot/htdocs"
<Directory "/path/to/docroot/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None

    Require all granted
</Directory>

ErrorLog "/path/to/logs/apache.error.log"
CustomLog /path/to/logs/apache.access.log common_cci

#############################################################################

Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Xss-Protection "1; mode=block"
Header always set X-Content-Type-Options "nosniff"
Header always set Strict-Transport-Security "max-age=63072000; 
includeSubDomains;"
Header always set Content-Security-Policy "default-src https: data: 
'unsafe-inline' 'unsafe-eval'"

# Template for Apache Virtual Host Configuration #
# Contains rewrite rules to support application-based redirection maps
# ___________________________________________________________________________
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<VirtualHost _default_:1098>

      # Valid Levels are trace1 through trace 8. 8 is highest.
      RewriteEngine On
        #LogLevel warn rewrite:trace3

#
# APP Rules
#
Include /path/to/configs/apache/launchpad.conf


#
# Catch URLs modified above to be full redirects # Note: These rules allow the 
replacement string in the map
#       file to be fully qualified or not. If not the default
#     protocol is HTTPS.
#
RewriteRule ^--proto--/--error--    \
  /launchpad.html [PT,L]


RewriteRule ^(--proto--/.*)--default--          $1?default=true [QSA]

RewriteRule ^(--proto--/.*)          
$1/TVApp?launchpad=%{REQUEST_URI}&launchpad-member=%{SERVER_ADDR}:%{SERVER_PORT}&now=%{TIME}
 [QSA]

RewriteRule ^--proto--/(https?://.*)      $1                      [R=301,L]
RewriteRule ^--proto--/(.*)         https://$1              [R=301,L]

#
# the failsafe is in case nothing maps in the map file #

RewriteRule ^/(.*) /launchpad.html [PT,L]

</VirtualHost>


Launchpad.conf

#LAUNCHPAD.CONFIG
# Rewrite Maps & App Rules
#
# Note: Apache fails to start if these files are empty or do not exist!!!
#
RewriteMap lowercase int:tolower
RewriteMap map-file     txt:/path/to/docroot/htdocs/maps/tv.dev.map

RewriteRule ^/maps/        -                [PT,L]

#
# TV Rules
#
# Note: This is being done in two stages to accomadate the ability
#     to default to the state entry if there is no entry for the
#     AU specified on the URL
#
#TEMPLATE?
RewriteCond %{REQUEST_URI}          ^/tv/(.*)/?                     [NC]
RewriteRule ^/                      ${map-file:${lowercase:%1}|--state--}

#TEMPLATE?
# /svp/STATE/AU
RewriteCond %{REQUEST_URI}          ^/tv/((([^/]+)/)?.*)/?                [NC]
RewriteRule ^--state--              ${map-file:${lowercase:%3}|--default--}

#TEMPLATE?
RewriteCond %{REQUEST_URI}          ^/(tv)/                         [NC]
RewriteRule ^(.*)             --proto--/$1                          [C]
RewriteRule ^(--proto--)/--default--      $1/${map-file:default|--error--}

#TEMPLATE?
#rewrite entire datacenter if in map eg, az-site1 ->sv-site1
RewriteRule ^(--proto--)/(.*)([0-9]\.glb.wellsfargo.net)/? 
$1/${map-file:${lowercase:$2}|$2}$3


Regards,
Dev


From: Eric Covener <cove...@gmail.com>
Sent: Wednesday, August 28, 2024 7:17 PM
To: users@httpd.apache.org
Subject: Re: FW: [users@httpd] rewrite rule issue with Apache 2.4.62

> Is there anything we need to update in config file for Rewrite rule? I 
> responded last week with followup questions. 
> --------------------------------------------------------------------- To 
> unsubscribe, e-mail: users-unsubscribe@ httpd. apache. org


> Is there anything we need to update in config file for Rewrite rule?



I responded last week with followup questions.



---------------------------------------------------------------------

To unsubscribe, e-mail: 
users-unsubscr...@httpd.apache.org<mailto:users-unsubscr...@httpd.apache.org>

For additional commands, e-mail: 
users-h...@httpd.apache.org<mailto:users-h...@httpd.apache.org>


Reply via email to