You want to redirect example.com/index.php/welcome to example.com/welcome ? Are you tired of finding proper solution about how to Remove index.php from URL to avoid duplicate content issue or to redirect index.php to actual URL without index.php? You are in the right place mate!
I am a PHP based developer and most of time I use CodeIgniter as my php framework. Those who use CodeIgniter and obviously other framework, we use some technique to remove index.php from our URL to make it more clean, short , Web 2.0 friendly and penitentially to avoid duplicate content issue in Google Web Master. In CodeIgniter, we do it in two steps:
How to remove index.php from URL in CodeIgniter
Step 1: We update application/config/config.php file
//keep the variable empty to remove index.php after your domain name$config['index_page']='';
Cool! That removes index.php from our URL.. thats really great… but wait! What if anyone put index.php in your url like http://www.example.com/index.php/welcome/ ? Yes that is still accessible and duplicate content of http://www.example.com/welcome/ .
How I removed the index.php from url
I had the same problem in one of my project and needed to solve it. I spend hours to solve it but couldn’t found any solution until I found this post htaccess remove index.php from url in stackoverflow. I just put following lines in my .htaccess file
CodeIgniter index.php and .htaccess issue ruined my last night. I’ve solved this simple issue many times before but not any solution was working that time.
Few days before today, I was working in a client project which I’ve been demonstrating to my client from my personal demo server which is a HostGator Baby Plan Hosting. The site was running fine in my local pc (Win7 running XAMPP 1.7.7 running the site in VirtualHost) and in my demo server but when I push the code in client’s staging server (Rackspace Cloud server with CentOS 6.4, Apache2 ) , I was getting a 404 Page Not Found error message. First I checked my .htaccess file and it was same as my demo server, same as my local pc which is
but nothing was working. I tried every solution I used before and I found over Internet but couldn’t find any perfect solution to solve my problem.
Everything seems fine and I was getting frustrated. Finally one solution I found where it says, I’ve to edit my httpd.conf file
and change AllowOverride None to AllowOverride All and saintly this solution worked Perfectly.
What Problem this was?
With my little understanding on server things, I understand that though we set the rule in .hetaccess to remove the index.php file, it was not fully permitted by staging.conf file. When working in Windows with XAMPP, this file location is in your drive:\xampp\apache\conf\extra\httpd-vhosts.conf
If you still reading, let me know if the solution work for you or If I need to update this posting in anywhere. I am open to creative suggestions
While working on my CodeIgniter based Open Source Project Management tool “Koronio”, suddenly I needed create a loop to generate a Dropdown element with array key as option value. This is very simple trick, provably everyone knows it, though I felt to share it.
Lets say, we have a php array named $priority which has 5 items.
I was developing an Web Application recently. Like all other web app, this has user registration process and password field for user. My client wanted to use a Password Strength Meter to indicate user how strong is his/her password. Well that’s a nice and must have feature for most of apps now.
I been searching for a jQuery plugin for this password strength feature and found a lots of plugins available for use. Well, I can’t use a lot of plugins but just one and I had to pick only one and I picked a simple one.