Open link with no .php-extension?
Posted by: jan6723 (---.inet.dsl.telianet.dk)
Date: April 20, 2014 07:48PM

When i use links with no extension fx..
<a href="/home">Load content of home</a>
..it works fine for .html-files - fx 'home.html' will get loaded.

But it does not work when the file is .php - fx 'home.php' - the browser shows this error:
"Not Found. The requested URL /html.html was not found on this server."

How do i make WAMP load files with the extension .php the same way as .html-files?

'



Edited 1 time(s). Last edit at 04/20/2014 07:54PM by jan6723.

Options: ReplyQuote
Re: Open link with no .php-extension?
Posted by: RiggsFolly (---.as13285.net)
Date: April 21, 2014 10:36PM

If you know you want to load 'home.php' then tell it you want to load 'home.php'.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Open link with no .php-extension?
Posted by: jan6723 (---.inet.dsl.telianet.dk)
Date: April 24, 2014 02:27PM

Issue solved by adding an .htaccess to root of WAMP with the following rules:

Options +FollowSymlinks

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
</IfModule>

Options: ReplyQuote


Sorry, only registered users may post in this forum.