php remove index php from url
How to remove index.php from URLs?
All of my URLs on my Magento installation require index.php in them, like:
The problem is that the system by default links to URLs like
Changing the SEO settings, flushing the configuration cache, and reindexing URLs did not work as suggested here.
8 Answers 8
This may be old, but I may as well write what I’ve learned down. So anyway I did it this way.
Before you start, make sure the Apache rewrites module is enabled and then follow the steps below.
1) Log-in to your Magento administration area then go to System > Configuration > Web.
3) While still on the Web page, navigate to Search Engine Optimisation tab and select YES underneath the Use Web Server Rewrites option.
4) Navigate to the Secure tab again (if not already on it) and select Yes on the Use Secure URLs in Front-End option.
6) Now go to System > Cache Management and select all fields and make sure the Actions dropdown is set on Refresh, then submit. (This will of-course refresh the Cache.)
If this did not work please follow these extra steps.
7) Go to System > Configuration > web again. This time look for the Current Configuration Scope and select your website from the dropdown menu. (This is of course, it is set to Default Config)
8) Make sure the Unsecure and Secure fields contain the same domain as the previous Default Config file.
9) Navigate to the Search Engines Optimisation tab and select Yes underneath the Use Web Server Rewrites section.
10) Once the URLs are the same, and the rewrite is enabled save that page, then go back and make sure they are all checked as default, then save again if needed.
How Can I Remove “public/index.php” in the URL Generated Laravel?
.htaccess
app/config/app.php
How can I change that?
17 Answers 17
Now you should be able to access the website without the «/public/index.php/» part.
Option 2 : Move things in the ‘/public’ directory to the root directory
Make a new folder in your root directory and move all the files and folder except public folder. You can call it anything you want. I’ll use «laravel_code».
Next, move everything out of the public directory and into the root folder. It should result in something somewhat similar to this:
After that, all we have to do is edit the locations in the laravel_code/bootstrap/paths.php file and the index.php file.
In laravel_code/bootstrap/paths.php find the following line of code:
And change them to:
And change them to:
I tried this on Laravel 4.2
Don’t get confused with other option the snippet below I am using and will be useful for you too. Put the below htacces in your root.
Go to your public directory and put another htaccess file with the code snippet below
HERE ARE SIMPLE STEPS TO REMOVE PUBLIC IN URL (Laravel 5)
1: Copy all files form public folder and past them in laravel root folder
2: Open index.php and change
For Laravel 4 & 5:
This likely has very little to do with Laravel and everything to do with your Apache configs.
Do you have access to your Apache server config? If so, check this out, from the docs:
To break this down, a couple things could be happening:
Hope this helps. I’ve named some of the most common issues but there are several others that could be more mundane or unique. Another suggestion on a dev server? Re-install Apache. If possible, do so from a different source with a good tutorial.
How to remove public/index.php/ from url in Codeigniter 4
12 Answers 12
Step 2: In the root project directory, open index.php and edit the following line:
and here is the first one «/.htaccess«
and the second one (comes with CI installation): «public/.htaccess«
Create a file called index.php outside of the public directory and write the command
Note: I just tested index.php URL issue and there was no issue like that. worked/loaded fine without index.php
create a .htaccess file in /public with :
Step 2: In the root project directory, open index.php and edit the following line:
change TO
have you tried this:
I was able to «solve» the problem in my hostinger server in one project. After I created a new project with a newer version of codeigniter 4 I realized that I could no longer use the same solution and after hours of research I found a very simple solution.
Using that trick I could load my codeigniter 4 in a live server without any problem. Actually, I used this to configure a codeigniter 4 project inside a subdomain.
Удаляем index.php из URL
Если у вас есть проект на Laravel, то вы удивитесь, обнаружив, что ваши маршруты открываются по разным URL-адресам.
Например, допустим, что у нас такой файл маршрутов:
Это создаст, как вы ожидаете, маршрут yourdomain.tld/feature/uptime-monitoring
Но для большинства вебсерверов это означает, что следующие URL-адреса также являются действительными и будут возвращать HTTP/1.1 200 OK с той же страницей:
Но вам вряд ли это нужно, так что давайте избавимся от него!
Удаляем index.php через код Laravel
Один из способов удаления — проверить маршрут в Laravel и, при необходимости, сделать редирект.
При обнаружении index.php в любом URL будет сделан редирект.
Есть несколько альтернативных способов получения того же результата на уровне вебсервера.
Редирект index.php в Nginx
Редирект index.php в Apache
Вы можете добавить дополнительную строку в свой .htaccess.
По крайней мере, это простая регулярка/фикс 🙂
Редирект index.php в Caddy
Получается немного громоздко, но, главное, работает для Caddy.
Наш Телеграм-канал — следите за новостями о Laravel.
Задать вопросы по урокам можно на нашем форуме.
remove index.php from cakephp url
how to remove the index.php from the cakephp url? In order to access my forms folder, I have to give the url : http://localhost/cake_1_2/index.php/forms.
how do i remove that index.php?
6 Answers 6
If you’re using CakePHP with mod_rewrite on (to get pretty URL’s) you can create new folders within WEBROOT and access files just fine.
CakePHP’s mod_rewrite is setup to check for existing files in WEBROOT and NOT pass them to index.php.
If you need to get up to folder outside of webroot you might consider playing with Symbolic links.
Check the CakePHP Install guide section for mod_rewrite. Once enabled in Apache, the pretty URLs will just work. If you’re not using Apache, you’re stuck with ugly URLs.
Your httpd.conf should look something like this:
After doing this, I can easily create routes & access pages like: http://localhost/about/
you can also check this mod rewrite tutorial here. it has general info which will be useful for url cleaning in many situations. there are also examples included.
Simply follow these following steps to verify it is there or not
The apachee server have the following configuration:
Also this line is uncammented:
Then restart your apache to see the changes
So, it should be ok? You already have mod_rewrite?