Closed Escarnope closed 6 years ago
Hi, the example directory is live here: http://pug-example.selfbuild.fr/ and use the same .htaccess
, as you can see, with no special changes, the URL rewriting is working.
Are local .htaccess and rewrite modules enabled on your machine?
Yeah they're enabled, they just don't seem to be working properly.
When I go to /page, it just shows the index page
Hum, maybe you have other redirections rules (in your vhost, or main apache config)?
Could you dump $_SERVER['PATH_INFO']
for debugging?
On /page : Undefined index: PATH_INFO
On index.php/page : /page
That's the difference (I get /page for both).
Hum, there are my apache options for the demo vhos: Options -Indexes +FollowSymLinks +MultiViews
Could you try to add each of +FollowSymLinks and +MultiViews to see if its help. I will inspect what can influence PATH_INFO, php version maybe.
I'm using PHP 7.1.12
And this is the .htaccess
Options -Indexes +FollowSymLinks +MultiViews
<IfModule mod_rewrite.c>
# Activate the rewrite engine.
RewriteEngine On
# If the path matches a file.
RewriteCond %{REQUEST_FILENAME} -f
# Then, return this file.
RewriteRule ^ - [L]
# Redirect any other request on index.php with the request URI as path info.
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
Maybe try this: RewriteRule (.*) index.php [QSA,L,E=PATH_INFO:/$1]
Source: https://stackoverflow.com/questions/8497404/php-serverpath-info-and-apache-mod-rewrite
Still not working
I have the same PHP version. And what is your Apache version? Is your site in a directory URL (http://site.com/directory)? Maybe you could upload a live example.
Maybe you could check this flag that can erase the PATH_INFO: https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_dpi
Hi, as I can't reproduce, I close this. If you have new information to debug, feel free to reopen.
I am using the index.php and .htaccess from the "example" folder
I was wondering, how could I get the URLs from
https://site.com/index.php/page to https://site.com/page