Welcome Guest, Not a member yet? Register   Sign In
Custom URL like www.companydirectory.com/mycompanyname/feedback in Codeigniter using htacess
#1

[eluser]Amitabh Roy[/eluser]
I posted this question at stackoverflow too, I am also posting it here, so that I can get this question to a more broader audience.

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

Code:
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
Code:
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 `
Code:
http://mainwebsite.com/samplecompany/feedback
Code:
http://mainwebsite.com/samplecompany/faq
and similar links for contactus, services etc

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

[eluser]mdhb2[/eluser]
my code work with this htaccess :

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>




Theme © iAndrew 2016 - Forum software by © MyBB