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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:30:02+00:00 2026-05-27T17:30:02+00:00

i want to build a website using codeigniter. The website is look like a

  • 0

i want to build a website using codeigniter. The website is look like a social agregator for my school. to build my website i plan :

  1. making a class “pages”. The class “pages” has a common function login,
    register , logout.. etc.
  2. making a “user” class the class “user” has a function related to
    user needs like: edit profile, add social api, view_profile etc.

i know if we want to see a profile we should pass an url like :

www.Mysite.com/user/view_profile/ <user name>

I dont know how to make a direct user pages (like permalink). i want my user can access his pages just only to type:

www.Mysite.com/ <user name>

i have read the user_guide in code igniter but i still dont understand what the url clas. is there any body can explain me how to make it ?

  • 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-27T17:30:03+00:00Added an answer on May 27, 2026 at 5:30 pm

    I would set up a route in application/config/routes.php that remaps any URL with a username as the first segment to the controller’s method serving your profile view.

    For instance, in your routes.php place this code:

    $route[':any'] = "user/view_profile/:any";

    The :any key will be passed as a variable to the function. Keep in mind that, by default, anything in that route (anything) will be routed to that controller’s method, so it might be a good idea to have your permalink structure look like this: yoursite.com/u/<username>, in which case you don’t need a route; you can just pass the uri segment like this:

    <?php
        class U extends CI_Controller
        {
            function __construct()
            {
                parent::__construct();
                // Load the users model
                $this->load->model('users_model');                
            }
    
            function index()
            {
                // Get the username from the URL
                $username = $this->uri->segment(2);
    
                // Get the users data from the database using the second URI segment
                $data['user'] = $this->users_model->get_user($username);
    
                // Load the view
                $this->load->view('path/to/view', $data);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My customer has a website (developed with php using codeigniter frame-work) and want his
I have a website project that I want to build using CruiseControl.net. On one
I'm busy making a CMS using MVC3. I want to test the current build
I am using cakePHP framework to build a website in which I want to
I'm using Drupal 7 to build a website. For production websites you might want
I want to build a website that uses Flex/Flash as the GUI, and Java
I want to build a community website with videoconferencing functionality integrated. I would prefer
I need to build a prototype for an intranet website, and I want to
I'm going to build a website using xhtml, css, javascript and php. And this
hi guys I've build a website using the zend framework and using clean urls

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.