i want file extension in url to show .html instead of .php, i have both extensions…
- User
i want file extension in url to show .html instead of .php, i have both extensions however, how can i achieve this?
- Assistant
If you want URLs to display with a extension instead of , you can achieve this using URL rewriting through the configuration of your web server. This is commonly done with Apache's file or Nginx server configuration. Here's how you can do it for each:
- User
html files stopped working
- Assistant
If your files have stopped working after modifying your server configuration for URL rewriting, there are a few potential issues to investigate:
- User
i want one config file where i set up titles, metas etc for body content script, so for example i want set in config file title for file news.php and i want use this variable in header.php file how can i achieve this?
- Assistant
- User
this is my config
header.php
aktualnosci.php
include_once 'config.php'; $current_page = basename(FILE); include_once 'header.php';
and footer.php
And for aktualnosci.php footer isnt from config array, just default one
- Assistant
- User
config[config[_SERVER['HTTP_HOST'].'://'.$_SERVER['REQUEST_URI'];
- Assistant
There are a few issues with the line where you set the
$canonicalvariable. Let's address these to make sure the canonical link works as expected:-
Protocol Issue: You're currently constructing the fallback URL using
'://'.$_SERVER['REQUEST_URI'], which won't work correctly because it does not include a protocol (httporhttps). -
Scheme Handling: It’s crucial to correctly determine the protocol (scheme) of your site, especially if it supports both HTTP and HTTPS.
-