apache - Redirect from root to Specific URI with HTTPD.conf -


the first rule works fine when maintenance file in place. when it's not - second rule not redirecting specific uri. there ordering issue of rules or ?

 #########################################     rewritecond %{document_root}/server_maintenance.html -f    rewritecond %{request_filename} !/server_maintenance.html    rewriterule ^.*$ /server_maintenance.html [l]    #########################################   ## %{http_host} evaluates http header name given in case host.server.org, nc being non case sensitive.   ## rewrite url @ server side append uri of lawson/portal   ##########################################################################    rewritecond %{http_host} ^host\.server\.org$ [nc]    rewriterule ^host\.server\.org$ "https\:\/\/host\.server\.org\/lawson\/portal" [l]    ######################################### 

you don't match hostname in rewriterule, more reason if matching in defined rewritecond.

so do:

rewritecond %{http_host} ^host\.server\.org$ [nc] rewriterule ^ https://host.server.org/lawson/portal [l] 

note: rewriterule target/destination not regix not need escape every single little thing.

note2: single ^ match anything


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -