Home » Archive

Articles Archive for May 2008

  Posted: May 12 | Filed under: ModRewrite

If you want to redirect your root site to a subfolder then the following code can help you:
RedirectMatch ^/$ http://name.com/forums/
Add that to your .htaccess file after “RewriteEngine On”.
The ^ is a regular expression and stands for the the start string, the $ stands for the end string.
If you are new to RegEx I recommend the Regular Expression Cheat Sheet!

  Posted: May 12 | Filed under: ModRewrite

If you want to hide your directory index so that people can’t see your files if they open a directory without a index file you have to add this to your .htaccess
Options -Indexes

  Posted: May 12 | Filed under: General

If you want to create a popup window to inform people about something before they visit a site, then it’s clearly a good way to use body onload in combination with javascript.


Use this little snippet inside your tag:

<script type="text/javascript">
function poponload()
{
ewindow=window.open("http://yoururl.com","mywindow1",
"location=1,status=1,scrollbars=1,
width=800,height=800");ewindow.moveTo(0,0);
}
</script >

And call it via the body tag.

<body onload="poponload()">
  Posted: May 12 | Filed under: General

Currently the first time I am connecting to my SQL database the loading time is very long. After that the loading speed is normal.

I will post possible solutions to make the initial connection faster here:
- HostNameLookups defined at httpd.conf is ON, set it to off
- Add skip-name-resolve to your my.cnf so that your SQL database is sending out a reverse IP lookup (more info here: Dotscr.org

To make sure that SQL is running with “skip-name-resolve” execute the following code via SSH:
mysqladmin variables

  Posted: May 11 | Filed under: General

I have noticed that it’s sometimes better not to define a width for a td because the IE and the FF interprete it differently. This might help if you try to arrange a sidebar and wonder why the IE is displaying it in another position.

  Posted: May 11 | Filed under: General

Sometimes the IE will expand a td or any other box without a reason.
This is due to a small bug. If it’s pure text then try using “word-wrap: break-word” inside your css file. To get it working for graphics and other things use style=”overflow:hidden”. Note that this might clip some of the data inside the td/box.

 

Source:Adobe.com