www.webdeveloper.com
Results 1 to 3 of 3

Thread: htaccess help

  1. #1
    Join Date
    Jan 2011
    Posts
    42

    htaccess help

    I was wondering if someone would be able to take a quick look at my htaccess code and see if there is anything incorrect or obviously done wrong. I'm a bit of a novice at this. You can contact me at slmkds (at) gmail.com
    Thanks!

  2. #2
    Join Date
    May 2012
    Posts
    37
    Or you could just post it...
    "A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
    -- Douglas Adams

    http://www.chaoscontrol.org
    Have you minified your CSS/JS lately?

  3. #3
    Join Date
    Jan 2011
    Posts
    42
    Good Idea:

    Here is the code:

    RewriteEngine on
    RewriteBase /

    RewriteRule ^(.+)\.shtml$ $1.html [R=301,L]

    redirect 301 /games.html http://www.slimekids.com/games/
    redirect 301 /trailers.html http://www.slimekids.com/book-trailers/
    redirect 301 /authors.html http://www.slimekids.com/authors/
    redirect 301 /reference.html http://www.slimekids.com/reference/
    redirect 301 /reviews.html http://www.slimekids.com/book-reviews/
    redirect 301 /searches.html http://www.slimekids.com/search-engines/

    RewriteEngine on
    RewriteBase /

    #if the domain is not www.slimekids.com
    RewriteCond %{HTTP_HOST} !^www\.slimekids\.com$ [NC]
    #redirect to www.slimekids.com
    RewriteRule ^(.*)$ http://www.slimekids.com/$1 [L,R=301]

    #leave this rule in place, but after the one above to handle the home page
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
    RewriteRule ^index\.html$ http://www.slimekids.com/ [R=301,L]

    ErrorDocument 404 /404page.html

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    </IfModule>
    ## EXPIRES CACHING ##

    (Do I need to put
    "RewriteEngine on
    RewriteBase /"
    in there more than once?)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles