Coder Social home page Coder Social logo
Output

URLS Framework - Take control of the address bar!

Why do you need it?

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!

Features

  • 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.

Requirements

  • 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.

Installation

  1. Open the urls_install.php file in your browser.
  2. Fill out the required fields.
  3. Start making your urls!

For a more complete example, see guides/INSTALL.md.

Simple example

  1. Install the URLS framework (see this guide).
  2. 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>
  3. 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();
    
    ?>
  4. Add $urls->path('blog/', 'blog-home.php', true); to your settings file under include '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();
    
    ?>
  5. If you did not specify a base url, go to http://yourdomain.com/blog/. If you did specify a base url, go to http://yourdomain.com/<your base url>/blog/. You should see the contents of the the blog-home.php file. Output

For more examples see GUIDES

Wiki

The wiki for URLS can be found at https://github.com/urls-framework/URLS/wiki

Documentation

The documentation for the URLS Framework can be found at the DOCS.md file.

License

This software is distributed under the Apache 2.0 license. For more information, read the LICENSE file.

Contributing

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

Issues

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

URLS Framework's Projects

urls icon urls

A small PHP framework that allows you to to create amazing URLs directly in PHP without .htaccess!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.