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 8483849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:13:10+00:00 2026-06-10T20:13:10+00:00

I am about creating a new website; content is classified as article; tag and

  • 0

I am about creating a new website; content is classified as article; tag and category
I have folder1 and folder2 which are folders on the remote web server; each of these two folders may contain HTML files

I want that everyone who is browsing my website

1-When he types 
    www.domin.com/folder1/ -->dispaly the index.html file under the folder1 folder

2-When he types www.domin.com/folder1 --> error

3-When he types 
www.domain.com/folder1/file1/ 
            dispaly the /folder1/file1.html file

4-When he types
    www.domain.com/folder/file.html or
    www.domain.com/folder/file 
             dispaly an eror: such file does not exist

Actually , what I done is the points: 1, 3
The following .htacces file content (under the public_html folder on the remote web server)

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^([^/]+)/$ $1.html

RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*[^.]+\.php(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]+/)*[^.]+)\.php$ http://www.domain.com/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ http://www.domain.com/$1/ [R=301,L]



#DirectorySlash On
#RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^([^\.]+)$ $1.html [NC,L] 
#RewriteRule ^([^\.]+)$ $1.htm [NC,L] 
#RewriteRule ^([^\.]+)$ $1.php [NC,L] 

I need help to modify my .htaccess file so to be conform with the points 2, and 4
thanks a lot

  • 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-06-10T20:13:11+00:00Added an answer on June 10, 2026 at 8:13 pm

    Try this it should support the 4 rules:

    RewriteEngine on
    RewriteBase /
    
    RewriteRule ^([^/]+)/$ $1/index.html [QSA,L]  # rule 1
    RewriteRule ^([^/]+)/([^/]+)/$ $1/$2.html [QSA,L] # rule 3
    RewriteRule ^[^/]+(/[^/]+(\.html)?)?$ doesnotexists.html [L] # rule 2 and 4
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im really new to flash, how do i go about creating a variable which
I'm creating a PHP website which involves users signing up, and I'm wondering about
I'm about to start creating a new website that has standard user management (customers
I am about to begin development of a new website and have been doing
Im using phpmyadmin for a website i'm creating and have a question about a
I am thinking about creating my new asp.net mvc web application compatible with native
I am thinking about creating a new repository in SVN for a section of
I'm new to creating installers using Visual Studio, and was wondering about the Global
I have been investigating about creating a UDP server, at first i though i
I'm creating a new website, I don't want to link direct to it so

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.