i want to hide index.php and controller name from my codeignier url website
also i want to replace this term ?seo=test-product ad /test-product
i have mention my htaccess file below please guild me how to fix this issue i have tried many things none helps
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteCond %{HTTP_HOST} ^(?:www.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
</IfModule>
2
Answers
try this
first we adding (.htaccess)(it is only extention file) file extention in our project directory
it is my project file directory location
http://localhost/demoproject
demoproject is my project name
copy below code and create (.htaccess) file and paste it under (.htaccess) file
these file create under project directory
one more (.htaccess) file create into view folder
copy below code and paste it under newly created (.htaccess) file
normally code controller file
DemoController.php
normally code our view file
DemoView.php
run localhost and only type localhost/project_name/controller_name
here we use demoproject as project name and DemoController as controller name
http://localhost/demoproject/DemoController
if your code not execute then please comment