Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
48% | Total: 521 | All time: 5,704 This week: 673 |
Version | License | PHP version | Categories | |||
status-404-find-best 1.0.1 | GNU General Publi... | 5.0 | HTTP, PHP 5, Text processing, Artific... |
Description | Author | |||
This class can find best match URL when accessing an invalid page. Innovation Award
|
When requested page URI is not found in the list of available pages, a closest matching page URI will be found and a redirect header will be returned.
This package will please all those concerned with search engine optimisation (SEO), and in situations where URIs often change; it eliminates the need for URL rewrites.
use peterkahl\NotFoundAlternative\NotFoundAlternative;
# For testing purposes, we set these; otherwise to be omitted.
$_SERVER['REQUEST_URI'] = '/contatcus?lang=en-us';
$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
$_SERVER['HTTP_SCHEME'] = 'https';
$_SERVER['HTTP_HOST'] = 'www.blah.sample';
# ---- End of testing variables ----
$notfoundObj = new NotFoundAlternative;
$notfoundObj->AvailableURI = array(
'/',
'/about',
'/products',
'/services',
'/contact-us',
'/news',
);
$notfoundObj->CheckURI();
# The script serves Status 301 permanent redirect header
# and Location header 'https://www.blah.sample/contact-us?lang=en-us'
# and then exits.
Files (4) |
File | Role | Description | ||
---|---|---|---|---|
src (1 file) | ||||
LICENSE | Lic. | License | ||
composer.json | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
status-404-find-best-2019-10-12.zip 6KB | |
status-404-find-best-2019-10-12.tar.gz 6KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
User Ratings | User Comments (1) | ||||||||||||||||||||||||||||||||||
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
Find the latest version on GitHub |