Wednesday, February 28, 2007

PHP 301 Redirect: Moved Permanently

WiaF MascotThrough years of programming websites and Internet database software, etc. I've decided to work mostly with PHP. PHP is a server-side scripting language that helps to create interactive websites. It is very useful for creating dynamic pages. (Pages that have one format but fill in different information depending on what information it is given.) This is common in any online store. Every product has the exact same layout, but it has different pictures, and words.

A great thing about PHP is it's free. It's largest server-side scripting language competitor, Microsoft's ASP, isn't. The PHP syntax is widely used and is very similar to C and Perl.

If I ever have a question about PHP or need information, I always go to http://W3Schools.com. It's also a great place for beginner programmers to get their foot in the door.

Here is how to us PHP code to make 301 Redirects:

301 Redirect: Moved Permanently
This code is for page redirecting. If you ever change a page name on your website, or take it down, you need to redirect that link to another page. This is because if you've had that page up for any period of time, the search engines like google.com or yahoo.com still think that it's there. Or another site may be linking to it. This will save visitors from getting lost and never seeing your site when they cliked on your link.

Here is the PHP code:
<?
header("HTTP/1.1 301 Moved Permanently");
header("location: http://www.yoursite.com/newpage/newfile.php");
exit();
?>

301 Redirect to "www."
This code I programmed because I wanted to make sure that whenever someone comes to my site, they come to the "http://www.websitesinaflash.com" (NOT: "http://websitesinaflash.com") So now whenever someone types in my website name without the "www." It will automatically redirect.

"Who Cares if there is a 'www.' in front of your website or not?
The biggest reason for this is so that search engines don't index two version of the same page. For example, if a Search Engine's bot find a link to my sight that doesn't have the "www." It will index the entire site without it. And if that happens, I'll have two exact duplicates of my website.

"Wouldn't that be a good thing?"
No. Search Engines will ding you if you have duplicate content. They see it as an attempt to cheat the system. I knew a man who changed the hosting and domain name for his website. But he didn't take down his old site. After a couple months, his old site which had had 3-4 Google Page Rank, now had 0 (zero). He realized this and took down his old site, and after half a year, he was back to normal.

Here is the PHP code:
<?
if($_SERVER['HTTP_HOST'] != "www.websitesinaflash.com")
{
header("HTTP/1.1 301 Moved Permanently");
header("location: http://www.websitesinaflash.com" . $_SERVER['REQUEST_URI']);
exit();
}
?>

And there's my two cents on 301 Redirecting with PHP.

-Enjoy
-Ashton Sanders

Labels: , , , ,

Product Comparison - Dreamweaver MX and 8

WiaF MascotFor the last 4-5 years I have been using Dreamweaver MX for most of my website design and Internet work. It was a great program in the beginning because I could create a page using tables in the design view, and then I could look at the code, and Dreamweaver MX would tell me the code that they used to create the page.

So if you are looking at learning HTML and how to make websites with tables, Dreamweaver is a great choice.

I recently upgraded to Dreamweaver 8. There are a number of key difference in this upgrade which make it 10x better than it's predecessor: Dreamweaver MX.

Websites Transfer:
The first thing that I noticed when I opened my Dreamweaver 8 for the first time is that it saved all of my sites from my earlier Dreamweaver, so I didn't have to spend a couple hours transferring all of my sites to the new Dreamweaver. I didn't actually have to do anything to start working on my website design or making corrections on the Internet. It was good to go.

File Activity Box:
The second this is when you are uploading something using MX, you can't do anything else. So if you have a couple videos to upload, a pop up window appears and you can't use Dreamweaver at all as long as that pop up window is in your way. You have to wait for them to finish uploading before you can do anything. In Dreamweaver 8, the window that pops up is entitled "Background File Activity." And it is just that. It works in a separate screen allowing you to edit open documents and continue working. (Note: Your computer can only have one connection to an FTP site at a time, so while you are uploading something you can't do anything else with the same or another remote server.)

Server Disconnection Notice:
On of my biggest annoyances with Dreamweaver MX, is that while I was working on a website design or Internet page, the connection to the remote server would get lost, and it would lag my whole computer for a couple seconds and then give me a pop up that read: "You have been disconnected to the remote server." Then when you clicked the cancel button, it would try to connect again. Truly a large waste of time for everyone. Thankfully, they removed this pop-up window in Dreamweaver 8. Now your connection to a remote host can last for hours, and if you get disconnected, the button will become unselected, and thats it!

Use of stylesheets:
As any Search Engine Optimizer knows, tables and commands can be some of the worst things for a website as they can clutter up your code, and make it difficult for search engines to index your entire site. In this new Dreamweaver 8, not only does it understand CSS very well in the website design view, but it you can tell it to format your page with CSS or depending on your preference. This is a great tool, because Email Newsletters should not use CSS includes, as they will sometimes get lost. So if you're doing a newsletter, you can just switch over to the tag for any visual work you need to do in the design section. It also knows all of the CSS commands, making it easier to learn new CSS!

Error Detection:
Dreamweaver 8 now has a great HTML error detector. It will tell you almost immediately any obviously incorrect tags you have on your page. A great tool for creating HTML and CSS Valid Pages.

So as you can tell, if Dreamweaver MX was okay, Dreamweaver 8 is AMAZING! and I can't wait to see what Adobe has in store for us with Dreamweaver 9! On that note, I cannot believe that Adobe has bough Macromedia! One of the two largest Internet program creator are now one. From PDF's to Flash, you get it all from Adobe now... But thats a subject for another post.

Until Then,
-Ashton Sanders

Labels: , ,

Monday, February 26, 2007

First Post - Internet Service Difficulties

Internet Service in Montana

WiaF MascotWelcome to the first post of the website design in a flash blog.

I've had CenturyTel DSL Internet Service for a while, and I liked them. I got Digital Phone and 1.5 MB DSL connection (nice and slow....) for about $100/month... But at least I got free long distance, and a pretty good phone number. I stayed with them for about 10 months. I left town for 5 weeks to visit family of the Christmas Break, so since I wasn't going to be using my DSL or phone, I decided to turn it off.

Unfortunately, I ran into a small problem: I signed up for a year-long contract, so I couldn't turn it all the way off. I thought that was reasonable enough; I had said I would stick with them for a year, so I would. I turned the Internet down to the lowest possible setting: Dial-up with 300 minutes of Internet time: $9.95/month. This brought my bill to about $30 for the month that I was gone. Great. That's not that bad.

This is where everything started going down hill: my cellphone died. So I called back, and the girl I talked to said that my account hadn't been updated, so we would have to do the whole process again. And this time, she said the cheapest Internet I could reduce down to was $19.95/month.... Weird. I just got off the phone with you guys and you said you could do it for $9.95/month. What happened in the last 5 minutes?

Anyway, I ended up with a promise of a bill that would be about $40 for the month, and they would help me forward my home phone to my cell phone. (Which to make a long story short, never worked. Until I called the 5th time and had them manually do it.)

My vacation time comes to a close, and I go home. I get the CenturyTel bill: $110.00.....

WHAT? Are you serious?

After an hour on the phone with these guys, I finally get my bill back to $40.00. So I decide to get cable Internet and just leave the dial up with 300 minutes in place for the next couple months until my plan runs out.

I get Digital Cable Internet, and I still have never used the dial up that I pay for $9.95/month for. I get the bill this month.... $110.00.... WHAT IS YOUR OBSESSION WITH THIS NUMBER?!?!?

Apparently, I used the dial up internet for over 1000 minutes last month.... Oh, wait... I haven't installed the dial-up software! I have been using another company's Cable for two months now...

Ending Thought: Don't use CenturyTel.

-Ashton Sanders

Labels: ,