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

  • Home
  • SEARCH
  • 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 8173255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:04:46+00:00 2026-06-06T22:04:46+00:00

The problem I’m having is that the first URL works and the second one

  • 0

The problem I’m having is that the first URL works and the second one doesn’t.

http://www.example.com/podcasts
http://www.example.com/podcast

They’re both HTML files, so adding .html to the second one will make it work. It’s only when the html extension is stripped away (which is what I want to happen) that the redirect problem appears.

I think the issue is that “podcast” is both a folder and an html file. In other words, there is a folder called “podcast” and there is also a file called podcast.html, the extension of which is automatically stripped away (which was my intention).

So how can I fix this redirect issue? I would like the folder and the html to still have the same names and the html extension to be be stripped away, as it is now.

Here’s a copy of my .htaccess file (edit: added L flags)

RewriteEngine On 
RewriteBase / 

#removing trailing slash 

RewriteRule ^(.*)/$ $1 [R=301,L] 

#non www to www 

RewriteCond %{HTTP_HOST} !^www\. 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 

#shtml 

AddType text/html .html 
AddHandler server-parsed .html 

#html 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^([^\.]+)$ $1.html [NC,L] 

#index redirect 

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/ 
RewriteRule ^index\.html$ http://example.com/ [R=301,L]

Pretty sure that the RewriteRule pertaining to %{REQUEST_FILENAME} !-f is causing the issue. The loop doesn’t occur for a 404 error.

Ideas?

  • 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-06T22:04:48+00:00Added an answer on June 6, 2026 at 10:04 pm

    Try putting this under your HTML section.

    RewriteCond %{REQUEST_FILENAME} !-d
    

    Your -f flag will prevent files from being considered in the rule, but this will exclude directories.

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

Sidebar

Related Questions

Problem: I have two array where one produce a category and the second produce
Problem Description: Multi-player Game that works over the some kind of network, in game
Problem description I have 6 databases from 6 different machines, and having one cloud
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
Problem description is here : http://www.spoj.pl/problems/FASHION/ Process : Took two lists as input ,
Problem: I have a table that prints out vertical but I would like it
Problem occured when i tried to display xml data that has been taken by
Problem: I'm working on a website where there is a dial that displays a
Problem One: </a> 19-10-2011, 04:49 PM </td> <td class=thread How to fetch the DATE

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.