Testing Apache Access or .htaccess file for redirection. This is for Apache Version 2.4

Опубликовано: 18 Июнь 2026
на канале: David L Cherry CodeNinja
24
1

Below is the code you need to put in you apache .htaccess file

Copy code below in you .htaccess file start testing redirects

RewriteEngine On

#redirect to website
#Redirect 301 https://www.somesite.com

#redirect to page to error page
Redirect 301 https://wwwsomesite.com/localhostLogi...

#Redirect to page in samedirectory
#This is the only way to redirect to page in same directory as the htaccess file. Never remove the below
#ErrorDocument 403 "index_login_error.php"


Disable directory browsing
Options -Indexes