Category: htaccess
Redirect Page
Redirect site root Redirect individual page
Redirect wordpress pages
Redirect wordpress pages to new location on same site Same example if your wordpress is in a sub directory Redirect wordpress category (directory) change
Redirect to new domain
Note – browsers cache redirects – if you change a redirect and then try again your browser may not be hitting the old domain when you return!!! Try using temporary redirect code 307 when you debug in place of 301 permanent redirect??? Redirect codes 301 – permanent redirect 307 – Temporary redirect Redirect from old domain to […]
Security htaccess rules to include
General security rules See our post here
Error Pages
#———- ERROR PAGE REDIRECTS ———- ErrorDocument 403 http://www.mydomain.com/index.php ErrorDocument 404 http://www.mydomain.com/index.php
Comments
Use the hash character: # Main Menu Links or use at each end if preferred # Main Menu Links #
Rewrite rules
Good Resources For Example Rules https://gist.github.com/ScottPhillips/1721489 Before the rules Options +FollowSymLinks RewriteEngine On RewriteBase / No Parameters Example RewriteRule ^groups$ groups.php [L] 1 Parameter Example RewriteRule ^flips/([^/]*)$ flips.php?fid=$1 [L] Converts this URL format: http://www.mydomain.com/flips/996803385327 To this actual php page http://www.mydomain.com/flips.php?fid=996803385327 2 Parameter Example RewriteRule ^flips/([^/]*)/([^/]*)$ flips.php?fid=$1&valueb=$2 [L] Converts this URL format: http://www.mydomain.com/flips/996803385327/hello To this […]