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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:37:57+00:00 2026-05-11T18:37:57+00:00

I am using these rules and conditions in .htaccess to turn these http://www.example.com/index.php/about/history http://www.example.com/about/history/index.php

  • 0

I am using these rules and conditions in .htaccess to turn these

http://www.example.com/index.php/about/history
http://www.example.com/about/history/index.php

into

http://www.example.com/about/history

.htaccess

# ensure there is no /index.php in the address bar
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
    RewriteRule ^(.*)index\.php$ $1 [R=301,L,NS]

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php(.*)\ HTTP/ [NC]
    RewriteRule ^index\.php/(.*) $1 [NS,NC,L,R=301]

Except there is a case where if the URL is

http://www.example.com/about/index.php/history/

It will result in an endless loop of redirecting. Now I know this is probably a rarity, but I’d like it not to happen if possible. How can I change my rules to accomodate this?

More info here about my .htaccess

  • 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-11T18:37:58+00:00Added an answer on May 11, 2026 at 6:37 pm

    If I understand correctly you just want to remove index.php whereever it appears? In that case your solution is overly complex. You probably want something like

    RewriteRule ^(.*)index\.php/(.*)$ $1$2 [NS,NC,L,R=301]
    

    This should be the only rule, no need for the RewriteCond’s as well

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

Sidebar

Related Questions

I'm using http://github.com/lakshmivyas/hyde to generate my website, and it included .htaccess mod_rewrite rules, but
I'm using http://github.com/lakshmivyas/hyde to generate my website, and it included .htaccess mod_rewrite rules, but
I'm using http://github.com/lakshmivyas/hyde to generate my website, and it included .htaccess mod_rewrite rules, but
I'm using vanilla forums which already has these rewrite conditions and rules in .htaccess:
I made the ultimate laugh generator using these rules. Can you implement it in
how do I build a find() query in cakePHP using these conditions: Find where
I'm using MVC with /<module>/<controller>/<action>/ have a module at example.com/module/whatever, and I need to
I have some conditions and rules in my .htaccess: RewriteCond %{DOCUMENT_ROOT}/assets/img$1/.$2.$4/$3.$4 -f RewriteRule ^assets/img(.*)/[a-zA-Z0-9-_\.]*\.[^/]+\.[a-z]{2,4}$
I'm using these two rules in my web.config file: <rule name=Enforce canonical hostname stopProcessing=true>
I am using these two functions in order to rotate my objects in my

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.