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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:44:39+00:00 2026-05-22T16:44:39+00:00

I am developing a site on Codeigniter 2.0.2 . Its a site where companies/users

  • 0

I am developing a site on Codeigniter 2.0.2 . Its a site where companies/users can signup and create their own profile page, have their own custom url(like http://facebook.com/demouser), have their own feedback system, display their services.

This said, I have been successful in display the profile page in the following format

http://mainwebsite.com/company/profile/samplecompany
This displays the home page for the company samplecompany , where company is the controller and profile is the method.

Now I have few questions,

  1. I guess it is possible to create to have/get http://mainwebsite.com/samplecompany using htaccess and a default controller. If anybody can help with the htaccess rule , that would be awesome. I am already using htacess to remove index.php from CI but could not get this working.

  2. There will be few other pages for the given user/company such as feedback, contact us, services etc. So the implementation links that come to my mind is of the form
    `
    http://mainwebsite.com/company/profile/samplecompany/feedback or
    http://mainwebsite.com/samplecompany/feedback

http://mainwebsite.com/company/profile/samplecompany/services or
http://mainwebsite.com/samplecompany/services

http://mainwebsite.com/company/profile/samplecompany/contactus or
http://mainwebsite.com/samplecompany/contactus


where
samplecompany` is the dynamic part
Is it possible to create site links in the format?

  1. I understand using A record for a given domain, I can point a domain say, http://www.samplecompany.com to http://mainwebsite.com/company/profile/samplecompany so typing http://www.samplecompany.com he should be taken to http://mainwebsite.com/company/profile/samplecompany . If this is successfully implemented, will
    http://www.samplecompany.com/feedback
    http://www.samplecompany.com/services
    http://www.samplecompany.com/contactus

work correctly?

  • 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-22T16:44:40+00:00Added an answer on May 22, 2026 at 4:44 pm

    I guess it is possible to create to have/get http://mainwebsite.com/samplecompany using htaccess and a default controller. If anybody can help with the htaccess rule , that would be awesome. I am already using htacess to remove index.php from CI but could not get this working.
    There will be few other pages for the given user/company such as feedback, contact us, services etc. So the implementation links that come to my mind is of the form ` http://mainwebsite.com/company/profile/samplecompany/feedback or http://mainwebsite.com/samplecompany/feedback

    You can accomplish this using routes. For example, in your /config/routes.php file, put this:

    $route['samplecompany'] = "company/profile/samplecompany";
    $route['samplecompany/(:any)'] = "company/profiles/samplecompany/$1";
    

    The first rule tells CodeIgniter that when someone accesses http://mainwebsite.com/samplecompany that it should process it as if the URL were “company/profile/samplecompany”. The second rule captures anything that comes in the URI string after “samplecompany” and appends it onto the end.

    However, if you have multiple companies(not just samplecompany), you’re probably going to want to extend CI’s router to suppor this unless you want to manually edit the config file each time a new company is added.

    OK, you’re definitely going to want to handle dynamic company names(as per your comment). This is a little trickier. I can’t give you the full code, but I can point you in the right direction.

    You’ll want to extend CI’s router and on an incoming request query the DB for the list of company names. If the URI segment matches a company name, you’ll want to serve it up using your company/profile method. If it does not, you will ignore it and let CI handle it normally. Check out this post on this topic for more information: forum link.

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

Sidebar

Related Questions

Im developing a site where its users can search for other users on the
I am developing site using codeigniter.I have a form which contains add button and
I am developing a stats site in Codeigniter locally. I have a url like
I am developing a site where doctors can manage their patients, appointments, etc. A
I've been developing a site using ASP.NET MVC, and have decided to use the
I am currently developing a site and have a need for a javascript-based carousel/slider
I'm developing a site that allows a user to create an order for a
i am developing a site that needs to have American and UK versions with
I am currently developing a site that users the jQuery superfish plugin to construct
I am developing a site (ASP.Net based) that, besides other features enables the users

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.