📲 Download Utility Tools Apps

EMI Calculator

Download EMI Calculator

SOA Games

Download SOA Games

SOA Technology App

Download SOA Technology

BMI Checker

Download BMI Checker

Task Jira

Download Task Jira

Laughing Adda

Download Laughing Adda

📅 हिंदी कैलेंडर ऐप डाउनलोड करें

Download Shubhcalendar App

htaccess url redirect for all urls except one

To redirect all URLs to a new destination in .htaccess except for one specific page, use RewriteCond to define an exception based on the REQUEST_URI before the RewriteRule. Place this code at the top of your .htaccess file, ensuring the exception URL starts with a forward slash.

Code Example: Redirect All Except One Page 

This example redirects everything to https://new-site.com except for /keep-this-page.html.

apache

RewriteEngine On
# Skip redirection for /keep-this-page.html
RewriteCond %{REQUEST_URI} !^/keep-this-page\.html$ [NC]
# Redirect all other pages permanently (301)
RewriteRule ^(.*)$ https://new-site.com/ [R=301,L]

Key Details

  • Exception Formulation: The ! means “does not match”. The ^ indicates the start of the URI.
  • Avoid Loops: Ensure the file you are excluding is not the same as your destination, or a redirect loop will occur.
  • Case Insensitivity: The [NC] flag makes the exception case-insensitive.
  • Testing: Use [R=302,L] (temporary) first to avoid caching issues in your browser while testing, then change to [R=301,L] (permanent) when ready.

Example: Excluding Multiple URLs

You can stack RewriteCond lines to exclude multiple paths (e.g., a page and a stylesheet). 

apache

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/keep-this-page\.html$ [NC]
RewriteCond %{REQUEST_URI} !^/assets/.*$ [NC]
RewriteRule ^(.*)$ https://new-site.com/ [R=301,L]


AI Spiritual Tools & Interactive Experiences

Explore powerful AI-driven tools for daily guidance, spirituality, fun quizzes, and self-discovery.

Today’s Quote

Get inspiring daily quotes powered by AI to motivate and guide your day.

Explore Now

AI Tarot Card Reader

Reveal insights about your future, love, and career with AI tarot readings.

Read Tarot

Love Match Calculator

Check compatibility and love predictions using AI-based analysis.

Check Match

Fortune Cookie

Open an AI fortune cookie and receive wisdom, luck, and fun messages.

Open Cookie

Quiz Categories

Engage with knowledge-based and fun quizzes across multiple categories.

Start Quiz

Panchang Calendar

View daily Panchang, auspicious timings, tithi, nakshatra, and festivals.

View Panchang

Online Numerology

Discover your destiny number, life path, and numerology predictions.

Calculate Now

Spiritual Feeds

Stay connected with spiritual thoughts, mantras, and divine content.

View Feeds

Quiz Hub

Attempt trending quizzes on GK, spirituality, festivals, and more.

Explore Quizzes