NGINX and APACHE URL Redirects

NGINX APACHE URL Redirects

Redirect all the requests to https

server {

listen 80;
server_name i90runner.com;
rewrite ^ https://$server_name$request_uri? permanent;
}

Redirect Specific Pages

rewrite /humor /humor/humor.php;
rewrite /events/search /Events/events_search.php;
rewrite /events/summary /Events/events_summary.php;
rewrite /photos /photos/index.php;
rewrite /help /Technology/blog.php?ID=344;
rewrite /hikes /Technology/blog.php?ID=386;

Redirect based on root URL

rewrite ^/humor /humor/humor.php;
rewrite ^/events/search /Events/events_search.php;
rewrite ^/events/summary /Events/events_summary.php;
rewrite ^/photos /photos/index.php;
rewrite ^/help /Technology/blog.php?ID=344;
rewrite ^/hikes /Technology/blog.php?ID=386;

Apache URL Redirects :

ServerAdmin [email protected]
DocumentRoot "/Users/development/Kaizen"
ServerName kaizen.local
ServerAlias kaizen.local

ErrorLog "/private/var/log/apache2/kaizen.local-error_log.log"
CustomLog "/private/var/log/apache2/kaizen.local-access_log.log" common

RewriteEngine On
RewriteRule ^/tech  /Technology/index.php
RewriteRule ^/humor  /Humor/humor.php

How to find Config File used by Apache on Mac

Rockys-MBP:sbin $ apachectl -V
Server version: Apache/2.4.16 (Unix)
Server built:   Jul 31 2015 15:53:26
Server's Module Magic Number: 20120211:47
Server loaded:  APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *