Open julianchristmas opened 6 years ago
Yes, we faced the same issue.
The solution was to put the redirection code as per https://stackoverflow.com/a/21813759/3113599 It's for nginx though.
I have the same issue. Using nginx. Is this a configuration problem or something the package can solve?
Using Nginx, I fixed the issue in my site config (thanks to @gauravmak 's link).
if ($request_uri ~* "^(.*/)index\.php(\/?)(.*)") {
return 301 $1$3;
}
Is there a recommended solution for apache?
I think you can use a 301 redirect in apache, after "Serve Cached Page If Available" condition, maybe you have to delete the entire cache first, something like this:
RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php|html)(.*)\ HTTP
RewriteRule ^(.*)index\.(php|html)$ /$1 [R=301,L]
Still index.php shown in url for cached pages with Laravel 5.5 ( Apache Server) Any solution plz?
For those who are using apache , Add this two line after RewriteEngine On in .htaccess
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
*clear the cache after.
First of all, thanks for this great package.
index.php shown in url
I have tested it on our simple Laravel website and found a little quirk. When visiting a cached page, the displayed url includes index.php This is not beneficial for SEO and UX, therefore I would like to change it.
Have anyone else experienced this issue and found a work around?
Prior to installing this package, urls where in the form of https://app_url.com/route
After installation and visiting all package to warm the cache, the urls are now in the form of https://app_url.com/index.php/route
Outcommenting the recommended lines from .htaccess resolves the problem, but views are no longer served from cache.
Apache configuration
Apache running with PHP 7.2 The full .htaccess file is as follows