Redirect .htaccess to custom Query_string

I have 2 files 1.) index.php 2.) index_intern.php

Both files do the same: they include the files in a subdirectory. Only different, index_intern.php will ask for basic authentication.

Now I want to write a redirect that will redirect the user from file 2.) to 1) if a predefined query string is not met.

The predefined Query_String where no redirection is done looks like this :? doc = intern / <. *>

RewriteCond %{THE_REQUEST} ^GET.*index_intern\.php [NC]
RewriteCond %{QUERY_STRING} !^(doc=intern/.*) [NC]
RewriteRule ^index_intern.php$  index.php%{QUERY_STRING} [R=301,L]

      

+3


source to share


1 answer


You can use:

RewriteCond %{THE_REQUEST} ^GET.*index_intern\.php [NC]
RewriteCond %{QUERY_STRING} !^doc=intern/ [NC]
RewriteRule ^index_intern.php$  index.php?%{QUERY_STRING} [R=301,L]

      



since ?

afterindex.php

+1


source







All Articles