How to remove "index.php" from query string? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to remove "index.php" from query string? (/showthread.php?tid=23324) |
How to remove "index.php" from query string? - El Forum - 10-07-2009 [eluser]tanveer[/eluser] Hi, I am facing some problems when i try to remove index.php from url. Here is code of config file. $config['base_url']= "http://www.mohsanat.edu.pk/"; $config['index_page'] = ""; $config['uri_protocol'] = "REQUEST_URI"; Here is code of htaccess file RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] 1) So problem is that when i use these code i got home page just type this http://www.mohsanat.edu.pk/ but when i go any another page after this http://www.mohsanat.edu.pk/index.php/welcome it gives the page but when i type this link http://www.mohsanat.edu.pk/welcome it does not show page. 2) Also when i use this setting i can not access my admin site here is my admin link http://www.mohsanat.edu.pk/index.php/admin but when i use these above setting i can not access my admin site it takes me the front end but i use default setting i can access admin site and remaining site but i also can not access the site from this url http://www.mohsanat.edu.pk/ also still i can not remove the index.php from url. Please can anyone help urgently plz. Thanks in advanced. Regards, Tanveer Hussain How to remove "index.php" from query string? - El Forum - 10-07-2009 [eluser]imn.codeartist[/eluser] [quote author="tanveer" date="1254917313"]Hi, I am facing some problems when i try to remove index.php from url. Here is code of config file. $config['base_url']= "http://www.mohsanat.edu.pk/"; $config['index_page'] = ""; $config['uri_protocol'] = "REQUEST_URI"; Here is code of htaccess file RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] 1) So problem is that when i use these code i got home page just type this http://www.mohsanat.edu.pk/ but when i go any another page after this http://www.mohsanat.edu.pk/index.php/welcome it gives the page but when i type this link http://www.mohsanat.edu.pk/welcome it does not show page. 2) Also when i use this setting i can not access my admin site here is my admin link http://www.mohsanat.edu.pk/index.php/admin but when i use these above setting i can not access my admin site it takes me the front end but i use default setting i can access admin site and remaining site but i also can not access the site from this url http://www.mohsanat.edu.pk/ also still i can not remove the index.php from url. Please can anyone help urgently plz. Thanks in advanced. Regards, Tanveer Hussain[/quote] Try using this RewriteEngine on AddType text/x-component .htc RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] #RewriteCond %{SERVER_PORT} !^443$ #RewriteRule ^(.*)$ http://www.mohsanat.edu.pk/$1 [R] see if it is works for you How to remove "index.php" from query string? - El Forum - 10-07-2009 [eluser]umefarooq[/eluser] hi check my following post and use the .htaccess file attached in that post it will work nice http://ellislab.com/forums/viewthread/129429/ How to remove "index.php" from query string? - El Forum - 10-07-2009 [eluser]tanveer[/eluser] [quote author="dixcoder" date="1254917989"][quote author="tanveer" date="1254917313"]Hi, I am facing some problems when i try to remove index.php from url. Here is code of config file. $config['base_url']= "http://www.mohsanat.edu.pk/"; $config['index_page'] = ""; $config['uri_protocol'] = "REQUEST_URI"; Here is code of htaccess file RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] 1) So problem is that when i use these code i got home page just type this http://www.mohsanat.edu.pk/ but when i go any another page after this http://www.mohsanat.edu.pk/index.php/welcome it gives the page but when i type this link http://www.mohsanat.edu.pk/welcome it does not show page. 2) Also when i use this setting i can not access my admin site here is my admin link http://www.mohsanat.edu.pk/index.php/admin but when i use these above setting i can not access my admin site it takes me the front end but i use default setting i can access admin site and remaining site but i also can not access the site from this url http://www.mohsanat.edu.pk/ also still i can not remove the index.php from url. Please can anyone help urgently plz. Thanks in advanced. Regards, Tanveer Hussain[/quote] Try using this RewriteEngine on AddType text/x-component .htc RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] #RewriteCond %{SERVER_PORT} !^443$ #RewriteRule ^(.*)$ http://www.mohsanat.edu.pk/$1 [R] see if it is works for you[/quote] Thank you but still i got the same problem what i do now. |