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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:59:54+00:00 2026-05-15T18:59:54+00:00

I was writing a PHP (Kohana) app and I saw that the controller index

  • 0

I was writing a PHP (Kohana) app and I saw that the controller index pages could be seen with & without /index.

http://plugb.com/ & http://plugb.com/index

In order to avoid duplicated content, I did this:

$clean_url = str_replace('index','',$this->request->uri);

if($clean_url !== $this->request->uri)
{
 $this->request->redirect($clean_url);
}

I would like to know how to do the same, but with .htaccess.

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-15T18:59:55+00:00Added an answer on May 15, 2026 at 6:59 pm

    Try this rule:

    RewriteRule ^index($|/(.*))$ /$2 [L,R=301]
    

    This rule will remove any leading /index from the URL path.

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

Sidebar

Related Questions

Basically I'm writing a PHP script that displays a Minecraft skin. I understand that
I am writing a PHP code that creates another PHP file with fopen and
I have lots of experience of writing php scripts that are run in the
I'm writing a php script that needs to load a 2D array into a
i am writing a kohana controller, and i am constantly getting a weired error,
I am writing a PHP script that will send via a cron an email
I'm writing a php script that takes some c code and tests it against
When writing PHP templates for WordPress pages we shouldn't use the <body> tag because
I'm writing php and I have a custom made control that is Grid and
I have found that writing PHP code within classes can become rather long: $this->parser->parse_syntax($this->get_language_path($this->language),

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.