Welcome Guest, Not a member yet? Register   Sign In
Remove index.page page from URL
#1

Hi

I have create web using codeigniter 2.x . I have created sub folders in controller as well as view.
Its working fine. I want to hide index.php page from URL but i am not succeeded to remove it.

I have remove index.php for config file as well as i have also write code.htaccess file but it does not work for me.

Code:
.htaccess code
RewriteEngine on
RewriteCond $1 !^(index\.php|images|fonts|js|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Mysite url is something like that : mysite/sitename/index.php/departments/departments/delete_department/14

Directory structure of my website

My site
   |_application
   |   |_ Controller
       |       |_Login (folder) // module folder
|_ pages
       |_Models
       |       |_pages
       |
       |_views
           |_login (folder) // module folder
|_ pages

So please help me how to remove index.php from URL
Reply
#2

Try it with this change

PHP Code:
RewriteRule ^(.*)$ index.php?/$[L

Reply
#3

PS: those are not "module" folders, unless you do HMVC
Reply
#4

(01-08-2015, 06:12 AM)Rufnex Wrote: Try it with this change


PHP Code:
RewriteRule ^(.*)$ index.php?/$[L

I have tried but it did not work. Index page does not remove from URL
Reply
#5

Is this the document root of your server: mysite/sitename/

Reply
#6

(This post was last modified: 01-11-2015, 11:44 PM by hkachhia.)

(01-09-2015, 11:46 AM)Rufnex Wrote: Is this the document root of your server: mysite/sitename/

Yes, Right now mysite is not publish. I am working on my PC
I am using wamp server on windows 7 64 bit and site is located in www folder
Reply
#7

Maybe mod_rewrite is not enabled. As I remember WAMP doesn't come with mod_rewrite enabled. Make sure is enabled
Reply
#8

btw . do you have removed index.php from your config?

application/config/config.php:
$config['index_page'] = '';

Reply
#9

(01-12-2015, 01:03 AM)Rufnex Wrote: btw . do you have removed index.php from your config?

application/config/config.php:
$config['index_page'] = '';

Yes... he did Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB