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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:56:23+00:00 2026-05-15T13:56:23+00:00

I am making use of Codeigniter and I currently have this URL format setup:

  • 0

I am making use of Codeigniter and I currently have this URL format setup:

http://example.com/view/

I would like to put in the logged in users username in the URL and remove the view part of the URL. The view is my controller. So I can have something that looks like this in the address bar:

http://example.com/johnny

However, I firstly tried removing the view part using my htaccess file like so:

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|images|css|js|swfupload|uploads|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA]

#trying to remove view??
RewriteRule ^(.*)$ view.php/$1 [QSA]

But this resulted in a 403 (forbidden) error as I have just corrupted the URL requested!

How can I best achieve this? Maybe making use of Codeigniter’s routes?

Thank you all for any help.

  • 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-15T13:56:23+00:00Added an answer on May 15, 2026 at 1:56 pm

    You basically have to make a route and then routes for everything else thats not for profiles. Its kind of annoying but thats how you have to do it in CI, I may be wrong. For example:

    $route['user/login'] = "user/login"
    $route[':any'] = "profile/$1"; // user profile
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making use of a captcha generator. http://xcaptcha.codeplex.com/ . In the example it shows
I have an AS3 project making use of compile time constants. This has worked
I am making use of constructors (classes) extensively and would like each constructor to
I have a weird problem. I am making kinda my own framework like codeigniter
I am making use of AJAX on my site and I would like to
I have see some apps making use of the extra space you find when
I have been making use of the WCF Authentication Service in ASP.Net but I
I am making use of Subsonic SimpleRepository i have a class: public class X{public
I'm making use of codeIgniter to upload files into folders in the server. Now
I am making use of this script to get the first item of 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.