It is nearly imposible to make URLs look nice in pure PHP. URLS is a micro framework that takes ugly URLs and allows you to rewrite it any way you want. That means you can turn this URL, https://examplesite.com/blog/home.php?post=1
into, https://examplesite.com/blog/post/1/
with no .htaccess
at all!
- Automatic Updates - URLS automatically checks for updates everytime it is called. It is recomended you disable this feature for produciton.
- Easy to Use
- Simple Setup - Just open the
urls_install.php
page in your browser and follow the simple instructions. - Custom HTTP Error Pages.
- Latest Version of PHP. Although URLS has only been tested on PHP 8, but it should still work on PHP 7 and possibly 5.
- Server running Apache with mod_rewrite. URLS uses
.htaccess
so it will not work on a Nginx server. However, we are working on a Nginx version.
- Open the
urls_install.php
file in your browser. - Fill out the required fields.
- Start making your urls!
For a more complete example, see guides/INSTALL.md.
- Install the URLS framework (see this guide).
- Create a new file named
blog-home.php
and fill it with:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>My Blog - Home</title> </head> <body> <h1>This is my Blog</h1> <p>Welcome!</p> </body> </html>
- Open the file you chose as your settings in your editor. It should look something like this:
<?php /* URLS framework url config file. Add your paths here: ex. $urls->path('blog/', 'blog-home.php', true); */ include 'urls/Urls.php'; Urls::$base = '/'; $urls = new Urls; $urls->exe(); ?>
- Add
$urls->path('blog/', 'blog-home.php', true);
to your settings file underinclude 'urls/Urls.php';
. Here is the file now:<?php /* URLS framework url config file. Add your paths here: ex. $urls->path('blog/', 'blog-home.php', true); */ include 'urls/Urls.php'; Urls::$base = '/'; $urls = new Urls; $urls->path('blog/', 'blog-home.php', true); $urls->exe(); ?>
- If you did not specify a base url, go to
http://yourdomain.com/blog/
. If you did specify a base url, go tohttp://yourdomain.com/<your base url>/blog/
. You should see the contents of the theblog-home.php
file.
For more examples see GUIDES
The wiki for URLS can be found at https://github.com/urls-framework/URLS/wiki
The documentation for the URLS Framework can be found at the DOCS.md file.
This software is distributed under the Apache 2.0 license. For more information, read the LICENSE file.
Currently, the URLS framework is a privately maintained project. If you find any bugs or have any suggestions, please submit them to the issue tracker. If you would like to edit the wiki, feel free to. However, we do ask that you follow our guidelines on how to post. See the Contributing page in the wiki for more information
If you find any bugs, please report them to the issue tracker. If you find a major security vulnerability, please DO NOT use the issue tracker to report them. See the SECURITY file for more information.
Copyright © 2022 Micah Baumann