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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:38:45+00:00 2026-06-13T11:38:45+00:00

So I have a page: http://www.mysite.com/controller/function The function is defined in the controller as:

  • 0

So I have a page:

http://www.mysite.com/controller/function

The function is defined in the controller as:

function ()
{
//some stuff here
}

However it is possible to resolve the URL:
http://www.mysite.com/controller/function/blablabla

i.e. “blablabla” can be passed to the function and forms an additional URI segment, but still brings up the same page. I have the same issue with a number of controllers / functions – how do I prevent parameters being passed to the function (or appearing as a URI segment)?

I’ve been working with Codeigniter and PHP for around 6 months very part time, so forgive me if the answer is obvious but my searches haven’t been fruitful on this.

My goal is optimised SEO – unsure whether better to redirect the page with the extra URI segment to the correct page or to the 404 page.

  • 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-13T11:38:46+00:00Added an answer on June 13, 2026 at 11:38 am

    You can’t prevent that without changing how CI handles URI parsing.

    You could force a redirect like so:

    function my_happy_function($redirect=null) {
       if($redirect) {
       redirect('/controller/my_happy_function/');
       }
    }
    

    That would strip out any variables that are given in the URI, at the cost of a page redirect.

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

Sidebar

Related Questions

if i start off on a Detail page: http:\\www.mysite.com\App\Detail i have a controller action
I have a web page on a which does some database updates (e.g. http://www.mysite.com/updates.asp
I have a page http://www.mysite.com/image.aspx , that I want to load and display an
I have page, i can contact directly without any problems. http://www.mysite.com/app_dev.php/comments/22 the page shows
So I have this page here: http://www.eminentmedia.com/development/powercity/ As you can see when you mouse
I am using JQuery Accordion. I have this page here: http://www.hauppauge.com/site/support/support_colossus.html#tabs-6 What happens is
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
I have a page with code... <script language=JavaScript> var link = <img src='http://www.mysite.com/file.php?var1=firstName&var2=lastName&var3=phone'>; document.write(link);
So I have this XML doc: <?xml version=1.0 encoding=UTF-8?> <Root> <Item> <URL>http://www.mysite.com/page?id=1</URL> </Item> </Root>
I have a web page with links pointing to downloadable files. For example: http://www.mysite.com/download.php?FILE=downloads/programming/various/ebook.pdf

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.