bg_image
header

CORS - Cross Origin Resource Sharing

CORS (Cross-Origin Resource Sharing) is a security mechanism implemented by web browsers to control which websites can access resources from other domains. By default, browsers block cross-origin requests—requests made from one website to another domain, protocol, or port—for security reasons.

Why does CORS exist?

Without CORS, malicious websites could secretly send requests to other servers (e.g., API servers or banking sites), potentially stealing or misusing sensitive data (Cross-Site Request Forgery, CSRF). CORS ensures that only explicitly allowed websites can access resources.

How does CORS work?

When a web application makes a cross-origin request (e.g., from http://example.com to https://api.example.com), the browser automatically sends a CORS request. The server must then respond with specific HTTP headers to indicate whether the request is allowed:

  1. Without CORS headers:
    The browser blocks the request.

  2. With CORS headers:
    The server can respond with Access-Control-Allow-Origin: * (allowing all domains) or a specific domain (Access-Control-Allow-Origin: https://example.com). This enables access.

Preflight Requests

For certain requests (e.g., PUT, DELETE, or requests with custom headers), the browser sends a preflight request using the OPTIONS method. The server must respond with the correct CORS headers to allow the main request.

Conclusion

CORS is a crucial security measure that prevents unauthorized websites from accessing foreign resources. Developers must configure the correct server-side headers to allow legitimate clients to access the data.

 


Duplicate Content

Duplicate Content refers to identical or very similar text appearing on multiple web pages, either within the same website or across different websites. This can happen unintentionally (e.g., due to technical issues) or deliberately (e.g., through content copying). Search engines like Google generally dislike duplicate content because it can harm the user experience and dilute search results.

Types of Duplicate Content

  1. Internal Duplicate Content: The same content is accessible via multiple URLs on the same website. Example: A page is available with and without "www" or with different URL parameters.

  2. External Duplicate Content: The same content appears on multiple websites. Example: A text is copied from another site, or several websites use the same manufacturer-provided product descriptions.

Issues Caused by Duplicate Content

  • Ranking Losses: Search engines may struggle to determine which page to prioritize, potentially ranking none of them highly.
  • Keyword Cannibalization: Multiple pages compete for the same keyword.
  • Loss of Trust: Search engines might perceive the site as less credible.

Solutions

  • Use Canonical Tags: Inform search engines of the preferred URL.
  • 301 Redirects: Redirect duplicate pages to the main one.
  • Create Unique Content: Focus on producing original content.
  • Manage URL Parameters: Use Google Search Console or technical adjustments to handle parameters.

Avoiding duplicate content is essential to maximize a website's visibility and performance.

 


Canonical Link

A Canonical Link (or "Canonical Tag") is an HTML element used to signal to search engines like Google which URL is the "canonical" or preferred version of a webpage. It helps avoid issues with duplicate content when multiple URLs have similar or identical content.

Purpose of a Canonical Link

If a website is accessible through multiple URLs (e.g., with or without "www," with or without parameters), search engines might treat them as separate pages. This can negatively impact rankings because the relevance and authority are spread across multiple URLs.

A canonical link specifies which URL should be treated as the main version.

How It Works

The canonical tag is added in the <head> section of the HTML code, like this:

<link rel="canonical" href="https://www.example.com/preferred-url" />

Benefits

  1. Consolidating SEO Strength: Prevents link equity from being split across multiple URLs.
  2. Avoiding Duplicate Content: Search engines only evaluate the canonical version, avoiding penalties for duplicate content.
  3. Improving Crawling Efficiency: Search engine bots don’t need to crawl every URL version.

Example

An online store has the same product available under different URLs:

  • https://www.store.com/product?color=blue
  • https://www.store.com/product?color=red

Using a canonical tag, you can declare https://www.store.com/product as the main URL.

 

 


Webpage

A webpage is a digital document that can be accessed via the internet and displayed in a web browser. It is part of a larger entity – a website – and typically contains text, images, videos, links, and other interactive elements.

Key Features of a Webpage:

  1. Content: It provides information or functionality for users (e.g., articles, images, forms, products).
  2. Address: Every webpage has a unique URL (Uniform Resource Locator), e.g., https://www.example.com/contact.
  3. Belonging: Webpages are usually part of a website, consisting of multiple interconnected pages.
  4. Structure: They are built using HTML (Hypertext Markup Language) for structure and content, CSS (Cascading Style Sheets) for design, and JavaScript for interactivity.

Common Types of Webpages:

  • Homepage: The central entry point of a website.
  • Informational Pages: Provide specific details (e.g., About Us, FAQs).
  • Blog Posts: Articles or posts with various topics.
  • Product Pages: Showcase products or services (commonly found in online stores).
  • Contact Pages: Offer ways to get in touch with the website owner.
  • Applications or Tools: Provide interactive features like search engines or online calculators.

Technical Definition:

A webpage is delivered by a web server and transmitted to the user's browser via HTTP or HTTPS protocols. The browser interprets the code (HTML, CSS, JavaScript) and renders the page visually.


What Makes a Webpage Unique?

  • Accessibility: It can be accessed from any internet-enabled device (PC, smartphone, tablet).
  • Interactivity: Modern webpages feature dynamic content, animations, and user interaction (e.g., forms or live chats).
  • Purpose: Webpages can inform, entertain, sell, or act as a platform for communication.

In short, a webpage is a single document that can be accessed online to deliver information or services. It is an essential component of a website, which consists of multiple such pages.