Entries Tagged as 'SEO'

mod_rewrite enabling url reqriting on apache and iss server windows and linux

URL reqriting is Simple Rewriting Your URLS (links) Also Redirecting Them To Known URLS.e.g you’ll make the link : view_my_profile.html –> Is Redirected to function.php?op=3
so instead of the link “function.php?op=3″ Which isn’t enough describing itself we’ll make the link “view_my_profile.html” Which is very describtive.Why using mod_reqrite?. Now see if your site has more than 10,000 Links (Dynamic Website) , do you think we would make 10,000 html files ??

=>Of course Not , and here’s the Use Of Mod-Rewrite. We can achive dynamic pages from code and rewrite their URL using this module.

=>well simply This is Very very useful for search Engines to correctly index Your website and gather keywords, we’ll talk about this in details in “Search Engine Optimization Tips”

How to Enable Mod_rewrite:-
how to configure mod_reqrite to work  It Depends On Your Operating System (Server’s Software) .

  • For Linux It’s Supported By Default (in Most Of The Servers) - ModRewrite Is An Apache Module You Don’t Have To Setup Anything And We wont Go On How To Install The Mod-Rewrite On Your Linux Server Cause It’s little Advanced And Complicated.However you can have mod_rewrite module loaded in apache.
  • For windows : A lot of developers think that it’s not supported by windows server but infact it is.I’ll Describe How You Can Set it Up On windows (Assuming That You Have IIS installed On Your PC/Server).But If You Haven’t Then You Can Refer To This Post: showthread.php?t=1 (http://www.phpegypt.net/forum/showthread.php?t=1)
    • For Windows XP / 2003 Server
      • You Must Download The Files From ( http://www.iismods.com/download.htm ) also I Attached It to This Post .. [It's Free Released under the GNU General Public License (v2)](May be this link is not working sometimes.)
      • Place It Somewhere on your H.D.D let’s Say “c:\mod_rewrite”
      • Goto Control Panel -> Administrative Tools -> Internet Information Services
      • You’ll Find Your Computer name And bet ween 2 Brackets (localhost) Click it -> open “Web Sites” -> “Default Website”.
      • Right click on “Default Website” Choose “properties”.
      • You’ll Find Many Tabs At The Top Click “ISAPI Filters”.
      • Click Add, Enter “MOD_REWRITE” As The filert name And For The executable Click “Browse” And Choose The file “c:\mod_rewrite\mod_rewrite.dll” or just choose The file “mod_rewrite.dll” Which You Extracted In The Desired Folder.
      • Now Click “Ok” ,Mod Rewrite Should Appear In The List now With Empty Status , and Filername = “MOD_REWRITE” and priority *unknown*..
      • Now You’re Ready To Run The MOD_REWRITE, Click Start->Run
      • Enter the following “iisreset” and click O.K It’ll Perform 4 Quick Operations (restart the iis server) And The window Will Close After That You’re Ready To Test Your ModRewriteNow Assuming That Everything Goes Right.
  • Apache/Wamp PHP based:-
    • For apache windows WAMP server you can turn the mod_rewrite extension on by
      • Right clicking on wamp icon click on mod_rewrite.
      • Restart wamp server.
  • Apache Linux/Windows Without WAMP:-
    • RewriteRule Source Destintion [options]

      Description:

      RewriteRule: Syntax Keyword That Must Exist Before Any Rule

      Source: The Source Link That Will Appear In Browser & For Users

      Destintion: The Translated (Replaced) Link That Will Appear To The Server.

      [options]: Some Extra Options That Can Be Left Empty

      e.g. [L] To make This Rule The Last And Server Shouldn’t Continue Fetching Rules After it . . . And many Other Options That Will Come Later

      Now Let’s Make Our First Example:

      RewriteRule ^helloworld.html index.php?module=hello

    • Now You Can Play Around With URLs Like :

      RewriteRule ^contactus.html index.php?oper=contactus

      RewriteRule ^aboutus.html index.php?mod=about

      RewriteRule ^login.html index.php?do=login

      .

      .

      .

      etc.

      * Just Remember

      Your .htaccess (apache) should be looking like this :

      RewriteEngine On

      RewriteRule ^login.html index.php?do=login

      Or your mod_rewrite.ini (IIS with mod_rewrite FILTER):

      Debug 0 # This Line Isn’t Important

      Reload 500 # This Line Isn’t Important

      RewriteRule ^login.html index.php?do=login

=>In Windows Your Rules Will be Written In The file “c:\mod_rewrite\mod_rewrite.ini” And In Linux (Apache) Rules Will be written in “.htaccess” (A File That Will/May be located on the root of your website).

So Configuring PHP on iss server is simple..!


Changing the DotNetNuke Page Title and Using dnn page titles

In a typical .Net web application you can change the title of a page on the fly by accessing the Page object’s Title property.

protected void Page_Load(System.Object sender,System.EventArgs e)
{
Page.Title = “My Custom Page Title”;
}

But from within your DotNetNuke module code you do it in a slightly different way. You first type-cast the Page object into a DotNetNuke.Framework.CDefault variable. Then you read and write the Title member on the CDefault object:

protected void Page_Load(System.Object sender,System.EventArgs e)
{
DotNetNuke.Framework.CDefault pageVar= (DotNetNuke.Framework.CDefault)Page;
cd.Title.Title = “My Custom Page Title”;//Set page title

titleDiv.innerHTML=”<b>”+cd.Title.Title.toString()+”</b>”;//Display Title of page In a Div at Page
}

If you compare Page.Title to CDefault.Title you will notice that Page.Title is a public property and CDefault.Title is a public member and you can use this for getting and setting page titles.

Let’s take a look under the hood of the framework. Inside the CDefault source you will find this code:

Public Class CDefault

Inherits DotNetNuke.Framework.PageBase
Public Comment As String = “”
Public Description As String = “”
Public KeyWords As String = “”
Public Copyright As String = “”
Public Generator As String = “”
Public Author As String = “”
Public Shadows Title As String = “”

You will notice that CDefault inherits from DotNetNuke.Framework.PageBase. Let’s take one step further and look at what the PageBase code looks like:

Public MustInherit Class PageBase Inherits System.Web.UI.Page

You can see that PageBase inherits from the System.Web.UI.Page class. What is going on is that CDefault is a descendant of PageBase, and inherently a descendant of the Page class as well. Thus it has all the members and method of those two classes.

However, CDefault defines its own public string called Title which “shadows” the Page.Title property. This essentially hides the Page.Title from Visual Studio’s IntelliSense when you’re viewing the properties and methods of a CDefault object.

Public Shadows Title As String = “”

So when you set CDefault.Title you are actually setting a different variable than Page.Title.

The nice thing about having the CDefault object around is that it exposes several other parts of the page for you to work with besides the title.

Public Description As String = “”

Public KeyWords As String = “”

Public Copyright As String = “”

Public Generator As String = “”

Public Author As String = “”

These members allow you to set the values of meta-data in your page header.

cd.Description = “My Custom Description”;

cd.KeyWords = “Coffee, Mojo, Hat”;

cd.Copyright = “My Company”;
cd.Generator = “Foo Coder”;
cd.Author = “Custom Author Name”;

Note that in the code above, cd is a CDefault object.

Knowing how to set these values can be important for those of you concerned with search engine optimization.
Working With The DotNetNuke Page URL

As you probably already understand, the typical DotNetNuke installation really only has one page, Default.aspx. The Default.aspx page receives the tab id (the id of the page it needs to display) via the query string using URL Rewrite. Inside the SiteURLs.config file in the root folder of your installation there exists the following rule which tells the URL Rewritting Http Module to convert the search engine friendly URL into a URL that passes the tab id to the default.aspx page via the query string:

<RewriterRule>
<LookFor>[^?]*/TabId/(\d+)(.*)</LookFor>

<SendTo>~/Default.aspx?TabId=$1</SendTo>

</RewriterRule>

This is a powerful tool that you can customize in order to make your module more functional.

Just as the DotNetNuke site uses the URL rewriter to reduce the page files down to just one, you can use the URL rewriter to reduce the module instance quantity down to just one. Let me explain.

Let’s say that you have a database table containing 10,000 records, each of which you want to provide individual pages for. Rather than generating 10,000 tabs / pages inside your DotNetNuke installation, you can create a URL rewrite rule like this:

<RewriterRule>

<LookFor>.*/Products/(.+)/(.+)\.aspx</LookFor>

<SendTo>~/Default.aspx?TabId=54&amp;brand=$1&amp;item=$2&amp;mode=view</SendTo>

</RewriterRule>

In this rule you tell the URL rewriter to look for a regular expression that matches a request that looks like http://www.yourdomain.com/Products/SomeBrand/ProductName.aspx, where SomeBrand can be anything and ProductName can be anything. Those two “anythings” will be the key to one of the records you wish to display from your database table. The rule rewrites the URL to point to a specific tab (tab 54) on which there exists an instance of your module. This allows you to have a unique URL for each of the 10,000 products in your database, but only one tab within DotNetNuke for displaying them.

Now your module can display whatever it pleases based on the friendly URL that was originally requested! Have your module fetch the brand and item parameters through the query string:

if (Request.QueryString["brand"] != null && Request.QueryString["item"] != null)
{
string path = Request.QueryString["brand"]+ “/” + Request.QueryString["item"];
// now use the path string as a
// key to a record in your database
}

Of course you need to take care not to pass on any old query string data on to your DAL. I usually run the values I get from the query string through some code like this which removes spaces and special characters:

// remove non [A-Za-z0-9] with spaces
myString = Regex.Replace(myString, “[^A-Za-z0-9]“, ” “);
// remove spaces
myString = myString.Replace(” “, ” “).Trim();

For the sake of simplicity you might consider passing the numeric id / key of the item in your database rather than the brand and product name text like the example above. By doing so you can keep your data redundancy low inside your database, and eliminate the chance of two items having the same path in the URL. On the other hand the URL containing only text might be considered more optimized for search engines. This is a trade-off you will have to consider on your own.

Final, here is one note regarding URLs for the Asp.Net beginners reading this. You will probably at some point want to advance the browser to one of the product URLs manually. This can be done using the Response.Redirect() method.

Response.Redirect(”/Products/”+ path + “.aspx”);


Using SEO,Common SEO facts and Myths Starting with SEO

After 1Y0-259 and EX0-101, all those PMI-001 professionals who wrote 642-825 say that they could not have done it without credits like 642-436 and 642-845.

SEO common facts

The Internet has many SEO myths flying around, many of which only survive as nobody acknowledges them as being wrong, Until now. I have plucked out 5 of the Internets best SEO myths to share with you today.


Here are 5 SEO Myths of my choice:

  1. You have to submit your website URL to Google in order to be ranked in the Search Engine Results Pages (SERP). - This has not been the case for many years.
  2. You have to update your website regularly in order to rank well. - This may only serve to increase your crawl rate but will have no effect on how your pages rank in the SERP.
  3. H1 tags are mandatory to reach top spot in SERP. - This is one of the myths that I have checked out alot, and it seems if your check alot of sites that rank highly on the SERP’s they do not contain H1 tags. But I believe that you should use them anyway as they do not hurt your site.
  4. You need to use a Google Sitemap to rank well. - I believe that if you have built your site correctly and it can be crawled then the Google Sitemap is only of use if you wish to use the Google Webmaster Tools.
  5. You have to use the META Keywords in your pages content. - The META Keywords were designed to add extra keywords to your site that were not mentioned in the content. The fact is that Google ignores this attribute anyway so it makes no difference.

If u want to add more or want to have suggestions then feel free to post your reply.


SEO defination Explaination and HElp for SEO terms

Utilizing free web hosting is alright to the extent that one makes use of adsl as well related jobs, particularly when associated with advertising agencies.

Few Questions:-

Do you run a website and often hear other website owners talking about their SEO tactics and realise that you have no idea what SEO is, or how you go about it? Well you have come to the right place, we will give you all the information you need to understand what other website owners are talking about and help you to get a good understanding of Search Engine Optimization (SEO).
What is SEO?

Search Engine Optimization is a practice under taken by website owners who wish increase the amount of traffic they receive from search engines. It works by improving internal and external factors in order to achieve a higher position in search engine results pages (SERPs). By achieving a higher ranking in SERPs you can obtain more traffic for the keyword searched. As you can imagine there are usually hundreds of sites fighting it out for the top search engine rankings, so website owners compete with each other to optimise their site so that they can gain the advantage over their competitors.

Do You Need To Use SEO?

SEO can often be a time consuming process and I have heard many webmasters ask the question ‘Do I Really Need SEO?’. The real question that should be asked is ‘Do I Want People To Visit My Website?’. You could have a great website and spend all your time adding to it, but if no-one is visiting it, is it worth it?

The fact is that when people what to find something on the Internet, they will search for it on search engines. If your website is not listed or is low on the SERPs then it is likely that you are not getting the most from your website.

The bottom line is, search engine traffic can make or break your site, so investing time or money in SEO is a must for anyone wishing to have a successful website.

As you should now understand SEO should be done by any website owner who wants to receive high levels of high quality traffic.

It is possible to receive traffic from search engines without performing any SEO, but by performing some of the basic SEO tips you can vastly increase your websites traffic.

We hope you now understand what SEO is and the impact it can have on your site.


Mail Yourself When Google Crawls Your Site php SEo notification

Many web hosting companies are now offering pay per click as well as other marketing methods along with domain names without having the necessary education.

PHP: Mail Yourself When Google Crawls Your Site

Search engines like Google crawls sites from database.Means they have a list of websites in their database for checking and a script suns every specified time to check the listed web sites.You may need sometimes to notify about this event.

Have you ever wanted to know when Google crawls your website? Well now you can using a simple PHP script which emails you every time GoogleBot crawls your site.

I thought that many of you might find this bit of code useful, that is why I have decided to post it up.

It is not a very long piece of code, but I will talk you through how it functions.

First off lets take a look at the code:

  1. <?php
  2. if ( strpos( $_SERVER['HTTP_USER_AGENT'], ‘Googlebot’ ) !== false )
  3. {
  4. // Your email address
  5. $email_address = ‘you@yourdomain.com’;
  6. // Send yourself an email
  7. mail($email_address,’Googlebot Visit Alert’, ‘The Googlebot has visited your page: ‘.$_SERVER['REQUEST_URI'].” at time:”.time());
  8. }
  9. ?>

As you can see it is a simple piece of code.

First of all it checks the user agent to see if it is ‘Googlebot’. If the user agent is ‘Googlebot’ then it will send an email to the email address you supply.