Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6161161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:25:57+00:00 2026-05-23T21:25:57+00:00

I am writing a multi language website. Therefore I would like some help with

  • 0

I am writing a multi language website. Therefore I would like some help with a URL rewrite problem.

Case:

  • When someone visits http://www.example.com without adding a country code (nl, en, de) the htaccess redirects the visitor to http://www.example.com/nl/ i.g.
    RewriteRule !(nl|en|de)(.*).* /nl/ [R=301,L]
  • The website is renewed and has got many url’s directing to the website (google, forums). i.g. http://www.example.com/oldpage-nomore.html. What I would like is the following; the htaccess should detect that the request uri doesn’t contain nl,en or de and should redirect to pagenotfound.php. RewriteRule ^(.*)\.html /public/oldurl?section=nl&notfound=$1$2&basehref=true&%1 [PT,L] the problem with this Rewrite rule is: all files ending in .html are being redirected.

What I am looking for is the following:

  • When someone visits http://www.example.com and no request uri is entered this should redirect to http://www.example.com/nl/
  • When there is a requested uri and this doens’t contain a countrycode (nl|en|de) than redirect to pagenotfound.php

I tried the following but it doens’t work:

RewriteCond %{REQUEST_URI} !^(nl|en|de)$
RewriteRule ^([a-z]{2})/(.*)\.html$ /pagenotfound.php?page=$2 [L,R=404]

I hope someone can help.
Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:25:58+00:00Added an answer on May 23, 2026 at 9:25 pm

    Try to place this .htaccess file at the server root folder:

    RewriteEngine On
    
    RewriteCond %{REQUEST_URI} ^/?$
    RewriteRule ^.*$ /nl/ [R]
    
    
    RewriteCond %{REQUEST_URI} !^/(nl|en|de)
    RewriteRule ^.*/(.*)\.html$ /pagenotfound.php?page=$2 [L,R=404]
    

    (you probably made several mistakes, I tried to fix them)
    I’m not sure with the first RewriteCond %{REQUEST_URI} regular expression – maybe remove the question mark or slash, I don’t now… can’t test now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing ASP.NET website which I would like to painlessly add CMS
Greetings Everyone. I'm currently writing a multi-language programe in C, C++ and fortran on
I'm writing my Servlet application and would like to use the following static method
When writing multi-threaded applications, one of the most common problems experienced are deadlocks. My
I am writing multi-thread socket chat in C++Builder 2009. It is almost complete in
I've read a lot recently about how writing multi-threaded apps is a huge pain
I'm writing an ItemAdding handler for a SharePoint list, and the list contains multi-user
Writing some test scripts in IronPython, I want to verify whether a window is
Writing something like this using the loki library , typedef Functor<void> BitButtonPushHandler; throws a
I'm doing some research on multicore processors; specifically I'm looking at writing code for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.