Score:0

Redirection of only home page to 404 not working

dm flag

What is needed is that https://cpc.dev.company.eu should redirected to 404 page, and all other like https://cpc.dev.company.eu/* and app1.dev.company.eu & app1.dev.company.eu/* should work as it is.

in nutshell what i want is only home page of cpc.dev.company.eu should be redirected

<VirtualHost *:8080>
    ServerName app1.dev.company.eu
    ServerAlias *-app1.dev.company.eu *-cpc.dev.company.eu cpc.dev.company.eu

    Timeout 300

    DocumentRoot "/srv/www/app1/public"

    Header set Access-Control-Allow-Origin "*"

    ErrorLog "/var/log/httpd/app1_error_log"
    CustomLog "/var/log/httpd/app1_access_log" proxy


    <Directory "/srv/www/app1/public">
        Options Indexes FollowSymlinks MultiViews
        AllowOverride None
        Require all granted
        DirectoryIndex index.php

        # Rewrite rules
        RewriteEngine On

        # Code to block cpc home page

        RewriteEngine on

        RedirectMatch 301 ^cpc.dev.company.eu https://cpc.dev.company.eu/404?
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        
        </Directory>

<FilesMatch "\.php$">
    SetHandler proxy:fcgi://127.0.0.1:9071
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
</FilesMatch>

SetEnv NEWRELIC_APP_NAME "app1 - dev"
SetEnv APP_ENV "dev"

not working

RedirectMatch 301 ^cpc.dev.company.eu https://cpc.dev.company.eu/404?

not working

RewriteCond %{HTTP_HOST} ^cpc.acc.company.eu [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^$ https://cpc.dev.company.eu/404? [R=301,L]

Works but along with home page of cpc.dev.company.eu the app1.dev.company.eu home page also redirects to 404 page

RewriteCond %{QUERY_STRING} ^$
RewriteRule ^$ https://cpc.dev.company.eu/404? [L,R=301]
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.