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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:19:47+00:00 2026-06-17T12:19:47+00:00

I have a condition for url redirect like, www.domain.com/something/anotherthing/index.php i need the above url

  • 0

I have a condition for url redirect like,

http://www.domain.com/something/anotherthing/index.php

i need the above url to redirect to

http://www.domain.com/something/anotherthing/

If i go to

http://www.domain.com/index.php/something/anotherthing

i want to redirect to

http://www.domain.com/something/anotherthing

i have a redirect htaccess rule for this

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s(.*)/index.php$1 [NC]

RewriteRule ^ /%1$1 [R=301,L]

But this works for the first condition but in the later it redirect me to the root page. Can anyone please help in this redirection.

Thanks 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-06-17T12:19:49+00:00Added an answer on June 17, 2026 at 12:19 pm

    Try something like this:

    RewriteBase /
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s(.*)/index.php/?([^\ \?]*) [NC]
    RewriteRule ^ %1/%2 [R=301,L]
    

    That should handle any location of /index.php.

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

Sidebar

Related Questions

I have url rewrite rules which redirect www.domain2.com to a subfolder under the root
I would like to redirect all www traffic to non-www traffic I have copied
I have a url shortener in my web app, like http://myProject1.example.com/76sBdFAf6L This stuff should
I want to create a condition that if page has parameter in URL like
I want to redirect /blog to /blog/. I have two condition if blog is
I have the following URL: http://testhost.com/offers/311/133/test@test.com/ and I'm wanting to redirect it to this
I have if condition and I want to disable or enable my actionLink button.
I have following condition: How do I send email to example@mail.com on submitButton clicklistener
Say, you have a condition like this; if ($condition_1 && $condition_2) and you have
Possible Duplicate: php false place in condition I have noticed that a lot of

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.