Skip to content

Instantly share code, notes, and snippets.

@seanwalsh
Created January 11, 2016 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanwalsh/e0d7a69b1fd9777bceda to your computer and use it in GitHub Desktop.
Save seanwalsh/e0d7a69b1fd9777bceda to your computer and use it in GitHub Desktop.
demo
RewriteEngine On
# REWRITE FROM WWW.EXAMPLE.COM TO EXAMPLE.COM
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
# REDIRECT HOMEPAGE TO /THIS-WEEK/ UNTIL HOMEPAGE IS CREATED
Redirect /index.php http://example.com/this-week/
#REWRITE ITEM/? TO THE INDEX FILE
RewriteRule ^item/([^/\.]+)/?$ item/index.php?id=$1 [L]
# REWRITE THE 404 IMAGE ERROR TO DISPLAY OUR ERROR IMAGE
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$
RewriteRule .* _assets/images/missing.png [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment