Podcast E272 – 5 more useful things to do with htaccess

This week I share 5 more things you can do with HTAccess

Upcoming Events

Segment 1: In the News

Segment 2:  More HTAccess Fun

Custom mod for a custom post type “shop”

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteRule ^/shop/(.+)$ /shop/ [L,R=301]


Force HTTPS + no WWW

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)(.+) [OR]

RewriteCond %{HTTPS} off

RewriteCond %{HTTP_HOST} ^(www\.)?(.+)

RewriteRule ^ https://%2%{REQUEST_URI} [R=301,L]

Default Character Set

DefaultLanguage enUS

Set Server Timezone

SetEnv TZ America/NewYork


RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?domain.com.*$ [NC]

RewriteRule ^ https://the-re-directed-url-goes-here/ [R=301,L]

Segment 3: Tool of the Week