5 Quick Tips for Site Owners
Here is a short list of handy tips for site owners.
Some of these are likely to be familiar. Perhaps one or more will be new.
1. PHP On Non-.php Web Pages
On most Unix/Linux servers, PHP can be enabled on .html, .shtml, and .htm web pages without renaming the entire site with .php file name extensions.
Insert these two lines into the .htaccess file of the directory with the web pages. The lines will also affect pages in all subdirectories.
AddHandler application/x-httpd-php .html .shtml .htm AddType application/x-httpd-php .html .shtml .htm
2. Breaking Out Of Frames
When someone puts your web page into a frame on their website, there is something you can do about it.
This JavaScript will break your page out of any frame it may be in. (Provided the browser is JavaScript enabled, of course.)
<script type="text/javascript"><!-- if(top.location!=location){top.location.href=document.location.href;} //--></script>
3. Useful PayPal Product Buy Link URL
Create a "Buy Now" button for a product and copy the email URL instead of the HTML code for the button.
Use the email URL as a product buy link URL in email, Twitter, blogs, Facebook, and other places that allow a URL to be published.
4. Efficient Page Redirect Code
Instead of messing with the .htaccess code, especially for temporary redirects, the following can be put in the web page.
<html><head> <meta http-equiv="refresh" content="0; url=_______________"> <script type="text/javascript"><!-- window.location = "_______________"; //--></script> </head><body style="margin:200px;"> If no redirect occurs, <a href="_______________">click here.</a> </body></html>
In the above code, replace _______________ in 3 spots with the URL to redirect the browser to.
The JavaScript works the fastest. Non-JavaScript browsers are redirected with the meta tag. And browsers with redirect disabled have a link to click.
5. Changing The Mouse Cursor
The mouse cursor can be changed within the content of any HTML container. A container is a div, A, span, or other HTML tag that contains content between the begin tag and the end tag.
Crosshair, help, move, text, wait, and other cursors can be set. See this CSS cursor property page.
The next line is an example:
Here is the code for the above example.
<div style="cursor:crosshair;">
The "crosshair" cursor is used on this line.
</div>
Insert the code in blue into any container tag. Change the cursor as appropriate for your implementation.
Five Site Owner Tips
The five tips are nice to keep at hand. When one is needed, it is generally needed right away.
Do something that will help you remember where the article is at or be able to find its URL when it's needed. Bookmark or publish a link in your blog, or Tweet it or Facebook it.
Will Bontrager