codeigniter-url

Want to create dynamic subdomain in codeigniter?

ⅰ亾dé卋堺 提交于 2019-11-28 07:02:44
In my site i want to add an functionality for user to use their username with domain. Like in codeigniter right now i want to give the user to use their own url to login in site and do other stuff. For eg: i Want www.username.mysite.com/login or www.username.mysite.com/category so here the user can login with their credential and add the category. so i have two controller in my site with login and category. So how to do this with the routes Or .htaccess. Use this code in server Vhost file: <VirtualHost *:80> DocumentRoot "/home/yourdoma/public_html/yourdomain" ServerName yourdomain.com

.htaccess and codeigniter not working

浪子不回头ぞ 提交于 2019-11-28 06:47:18
问题 I am using snow leopard and I have my local environment and I am trying to get rid of the index.php in the url...here is what i have DirectoryIndex index.php RewriteEngine on RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] My config file has this $config['index_page'] = ""; But when i visit the page without index.php it doesnt work this works http://localhost

Codeigniter _remap function

半腔热情 提交于 2019-11-27 21:29:11
问题 Please help I want to use first URI segment into my CodeIgniter website. Like when I open these url they opens my profile: http://www.facebook.com/buddyforever or http://www.myspace.com/zarpio How can I do this with CodeIgniter? I checked _remap function but first coming controller how to hide controller? 回答1: You can do this using the URL routing of codeigniter... If you want your URL to be http://www.mydomain.com/zarpio and you want it to refer to your_controller , then do the following.

Relative path or url for html src and href attributes

谁说我不能喝 提交于 2019-11-27 08:18:59
问题 Using a framework makes it easy to list full url's for my html src and href attributes, and I feel I'm being more thorough by listing a full url instead of a relative path. But is this faster? Am I incurring an extra DNS lookup? What is the best practice when the content is on the same server? <img src='http://site.com/images/img1.png' /> vs <img src='/images/img1.png' /> Codeigniter's image helper img() works like this from the users' guide: echo img('images/picture.jpg'); // gives <img src=

Want to create dynamic subdomain in codeigniter?

泄露秘密 提交于 2019-11-27 05:43:41
问题 In my site i want to add an functionality for user to use their username with domain. Like in codeigniter right now i want to give the user to use their own url to login in site and do other stuff. For eg: i Want www.username.mysite.com/login or www.username.mysite.com/category so here the user can login with their credential and add the category. so i have two controller in my site with login and category. So how to do this with the routes Or .htaccess. 回答1: Use this code in server Vhost

How to make CodeIgniter accept “query string” URLs?

落爺英雄遲暮 提交于 2019-11-26 16:32:48
问题 According to CI's docs, CodeIgniter uses a segment-based approach , for example: example.com/my/group If I want to find a specific group (id=5), I can visit example.com/my/group/5 And in the controller, define function group($id='') { ... } Now I want to use the traditional approach, which CI calls "query string" URL. Example: example.com/my/group?id=5 If I go to this URL directly, I get a 404 page not found . So how can I enable this? 回答1: For reliable use of query strings I've found you