calmestghost.com | + share

Use Firefox: Spread Firefox Affiliate Button
bhadaway@gmail.com | subscribe

Socialize: Bryan Hadaway's LinkedIn Page Bryan Hadaway's Twitter Page Bryan Hadaway's Facebook Page Bryan Hadaway's MySpace Page
Signup for HostMonster

There’s always a learning curve and margin of discomfort when learning something that you really want to do for the first time. So, hopefully I can simplify and jump start the whole process for you with a really easy, super simple way to get started building your very own WordPress plugin.

Continue reading »

Bookmark and Share
Google Buzz
Tagged with:  

Options -MultiViews +FollowSymlinks
RewriteEngine on

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .? http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteRule ^/?(.*/?)index\.(htm|html|php) /$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

RewriteCond %{REQUEST_URI} !^/search-results
RewriteCond %{QUERY_STRING} !=”"
RewriteRule ^(.*)$ /$1? [R=301,L]

ErrorDocument 404 /sitemap

I use this file for the FREEWebPlate website template I built | View Demo

In order from top to bottom, I’ve marked parts in bold that you may want to alter:

- index | you may change this to: default if that’s what you’re using

- htm|html|php | you may add more extensions like so: htm|html|php|asp

- php (both places) | you may change to any other file type extension; htm, html etc.

- /search-results | you’ll need to specify what folders/files you want to allow query strings (?) on, add a new line for each

- /sitemap | you’ll need to specify what page/URL you want 404 pages to go to

For more advanced users, you can of course alter it however you like.

What this Script Does

  • Enforces www in URLs
  • Removes index.htm, index.html and index.php from URLs
  • Allows you to link to cleaner versions of URLs without using the extension (use website.com/contact instead of website.com/contact.php)
  • Strips query strings from URLs except for the folders and files you allow
  • Forwards/redirects 404 error pages to the page of your choice

Enjoy.

Thanks, Bryan

Bookmark and Share
Google Buzz
Tagged with:  

How to Create Circles with CSS

On May 25, 2010, in CSS, How-to, Script / Code, Web Design, XHTML, by Bryan Hadaway

Creating circles with CSS is very simple, but not very well supported. If your design depends on circles you should definitely use background images, but if your audience is tech savvy or you just don’t care the following styles will work in Firefox, Safari and a few others I’m sure:

Continue reading »

Bookmark and Share
Google Buzz
Tagged with:  

Typically if you want to dynamically link to a W3C Valid CSS page, we use this link:

http://jigsaw.w3.org/css-validator/check/referer

That’s perfect if you’re using ALL CSS2.1 as that’s the default checker, but if you implement even 1 CSS3 style you’ll fail validation. So, we can no longer use the referer method until CSS3 becomes highly supported to the mainstream.

So, as a compromise, instead of linking our pages to the referer link, we’ll have to link our stylesheet to the CSS3 Validator like so:

(remember to use & amp; with no spaces between & and amp; in place of & so you don’t break XHTML Validation)

With a little PHP magic we could generate the current page URL dynamically in place of:

http://www.website.com/css/style.css

But, you might find this difficult from the footer.php, if someone could re-work the following code to work properly when using a dynamic footer.php file please share:

Thanks, Bryan

Bookmark and Share
Google Buzz
Tagged with:  

This will enforce forwarding / redirection to the www version of your pages, enforce clean URLs by removing index.php, index.html and index.htm and by removing query characters like ? where they don’t belong adding exceptions for folders/files where they are allowed and my favorite part, forwarding / redirecting 404 error pages to the page of your choosing, check it out:

RewriteEngine on
RewriteBase /

RewriteRule ^index\.(htm|html|php) http://www.website.com/ [R=301,L]
RewriteRule ^(.*)/index\.(htm|html|php) http://www.website.com/$1/ [R=301,L]
RewriteCond %{HTTP_HOST} !^www\..*
RewriteRule ^.*$ http://www.website.com%{REQUEST_URI} [R=permanent,L]

RewriteCond %{REQUEST_URI} !^/search-results.php
RewriteCond %{QUERY_STRING} !=”"
RewriteRule ^(.*)$ /$1? [R=301,L]

ErrorDocument 404 sitemap.php

Bold parts are places you can edit. Simply paste the code in Notepad and then change website.com to your websites info, change search-results.php to the page you want to allow query strings on like a search results page, change sitemap.php to whatever page you want users to reach if they’ve reached your site in error, you can simply make it / if you want 404 errors to redirect to your homepage.

Save text file as .htaccess with “All Files” selected and then upload to the root folder of your website, this is often called public_html, just make sure it resides next to your index file.

Enjoy.

Thanks, Bryan

Bookmark and Share
Google Buzz
Tagged with:  

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

    © 2010 BryanHadaway.com. All Rights Reserved. | Theme By: PageLines | Designed By: calmest_ghostDESIGN
    Proudly Powered By: WordPress | Articles (RSS) and Comments (RSS) | Valid XHTML
    preload