Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [url-routing]

URL routing lets you configure an application to accept request URLs that do not map to physical files.

4
votes
2answers
166 views

Load other files (from outside public_html) under index.php

I wanted to load every page under index.php with a simple index.php?do=login For example when the link index.php?do=login or <...
0
votes
0answers
20 views

70L React Router

This is a small router for a React application. Router changes the displayed content depending on the current location. Link changes the location when the user clicks on it. navigate changes the ...
3
votes
0answers
35 views

Generic router in Rust

I am trying to make a router in Rust using Rocket.rs. I'd like to devise a way to use a default router for my more simple db tables that don't require different logic, to prevent rewriting the same ...
1
vote
1answer
88 views

Simple MVC built in PHP

I tried to make a MVC in PHP with OOP approach. Code Review this so I can understand whether am I using the best practices and can I legally call it a MVC framework or not. Also, I am going with 1 ...
2
votes
2answers
51 views

Minimizing duplicate routes index.js

I am trying to build a REST API with express router, which contains of nested sub routes. I have mounted these sub routes in my index.js file. I have defined it as ...
2
votes
1answer
71 views

create static page with vuejs

I have a static homepage with some routes and thought about creating this with VueJs. I am totally new to this and just know NodeJs with Handlebars. So normally I would have something like this <...
3
votes
0answers
108 views

Client-side routing using Knockout and HTML5 History API for a single-page web application

The full question is... "Please, how can this code base or project (for client-side routing using Knockout and HTML5 History API) be further enhanced as regards security, production-readiness, ES6, ...
2
votes
0answers
156 views

Python (Sanic) Routing

I am new to Python and wanted to explore how I can associate routes with "controllers" with Sanic as a base. It works fine but "feels" a bit clunky but I can't put my finger on why/how. routes.py - ...
0
votes
0answers
41 views

Url routing using php and .htaccess

While I'm learning about the MVC pattern applied to the web using the PHP language, I wrote this code that is supposed to route the requests and instantiate the correct controller and method. I will ...
4
votes
1answer
452 views

Generating absolute URIs behind a reverse proxy

In my ASP.NET MVC application there are occasions where I need to generate an absolute URI, such as when sending an email confirmation link to a user. The most straightforward approach is to use ...
4
votes
2answers
75 views

Assigning several variables from request URL using regexes

I refactored some of my code: Summary: This implementation works with PSGI/Plack. It gets the URL from $env->{PATH_INFO} and assigns a different variable ...
2
votes
1answer
71 views

Simple routing system

This is my first routing system on PHP. As you can see it's very simple. Any advice or tip about it that can make it better? I want to make it better so I could use it in real websites. First I ...
1
vote
1answer
34 views

Node router for marketplace routes

After cleaning up & some refactoring, one module of my code became like below. However, I'm feeling like there's still some unnecessary redundancy, and it can be improved further and look neater. ...
1
vote
2answers
48 views

URL Routing Application

In a Ruby on Rails application I want to have this routing: for URL www.example.com/reports go to controller documents and action ...
3
votes
1answer
866 views

Simple PHP Router for home grown MVC framework

I don't know if you guys get tired of seeing a bunch of requests for review of similar projects, but I was really looking for advice. My website is designed on the MVC pattern. I have a very simple ...
3
votes
1answer
72 views

Express.js routes management for large web application

I'm currently working on a large web application with numerous routes. Currently, our routes are in one large list in a single JSON file. We recently ran into a problem due to the precedence of ...
0
votes
0answers
102 views

Very simple RESTful API dispatching in PHP

This code is meant to be a very simple RESTful API. The simple router takes the URI request and maps it to a function with a matching name. E.g. www.domain.com/bill maps to function bill(). Then bill ...
-2
votes
2answers
416 views

Extracting parameters from request URL path components using regexes

The code is not efficient, let's say the url matched in the first regex case but I'm still evaluating second regex for the second case while knowing it's mutually exclusive and only one of them will ...
3
votes
1answer
56 views
1
vote
0answers
255 views

Simple blog using react redux react-router

I've implemented the logic of my app, but I'm not sure whether it appropriate way or not. Task: create a react app using redux, react-router v4 which has a page with a form for adding new post and ...
8
votes
1answer
387 views

A very basic web framework inspired by Flask

I was curious how hard it would be to implement a routing system like flask uses. As it turn's out it's actually not that hard if you understand how decorator's ...
1
vote
1answer
689 views

PHP OOP API Class

I want to do an API or contract in Laravel focus when one person wants a contract or credit, but honestly it's for a scholarship but the process it's similar when I got a credit from a bank. Honestly ...
1
vote
0answers
164 views

PHP - Uri Parser for Routing

I'm trying to build my own PHP MVC framework. I want to implement a routing similar to how ExpressJS/NodeJS implements its routing by making use of Request Handlers. ...
1
vote
1answer
69 views

PHP code to show a PHP page

I'm trying to avoid manually updating a whitelist of pages, so I wrote the following that I might use, but I'd like my fellow, more experienced, developers to let me know if this is safe. By safe, I ...
1
vote
2answers
4k views

PHP Routing with MVC Structure

I'm trying to do a simple CMS with PHP from scratch using MVC structure. Yesterday I posted this, which is a login system using PHP and it works but it has a handful of problems regarding the OOP ...
3
votes
2answers
151 views

PHP MVC framework

I am kind of new to MVC, I've read lots of tutorials online but each keep using different approaches so I decided to create mine. Below is what my code looks like. index ...
1
vote
1answer
32 views

Dual rewrite rules (WWW prefix and HTTPS)

I want to configure my website to force a www. prefix on the name, and the HTTPS protocol. ...
1
vote
0answers
58 views

Request Router written in Go

I started to learn Go language and I figured to write another request router as I am going to need it for my next Go project. As it is my first thing written in Go I appreciate comments and ...
2
votes
0answers
537 views

React app with paging

I want to create react app with paging, which will keep state on page reloading. I'm using react-router-dom and my own Paging ...
2
votes
1answer
209 views

PHP Dependency Injections w/ Router

I've been working on a personal from-scratch project for the purpose of learning, and so far I've been able to successfully build a DI container and a simple URI router. It works as expected right now,...
3
votes
1answer
83 views

Defining routes and controllers relationship for given pages

I'm building a CMS app with the help of a custom framework. The back-office is composed of the following pages: post list page list user list post edit page edit user edit Actually, my routes are ...
8
votes
2answers
187 views

Node JS routing system

I am doing a website for an association and I have never done the server side before. Here I made a very simple routing system: ...
2
votes
0answers
134 views

MVC routing with duplicate method entry points

The 3 methods below all need to have the same name: "Roles" They need to be the same as I have a permissions system that will only allow the execution of a "Roles" method. I don't feel too happy ...
3
votes
2answers
103 views

Basic Go HTTP router

I know Gorilla and others have packages that accomplish this, but I'm trying to learn Go by making stuff. In the router below, the first route / is for all http ...
2
votes
2answers
116 views

PHP Response Wrapper

I'm writing a routing system that may or may not be part of a public API later for a personal project. A main part of the routing system is a response object for the user to send headers, status code, ...
2
votes
1answer
175 views

Routing System request syntax

I'm working on writing a routing system for a PHP project. I'm trying to write it in a way that it can easily be expanded later on via plugins. I have 2 ideas for how to go about doing it. I've ...
3
votes
0answers
2k views

Routes requiring authentication in react

I'm looking for a way to do some route protection with react-router-4. Looking at an example in the documentation, they create a Component which is rendered like this: ...
1
vote
1answer
135 views

Serve folder content using PHP route (SSI) (dynamic includes)

I have just written a PHP router, but I have some security concerns about this function. I am trying to serve all the content of a folder using this function. I am trying to prevent harmful URLs. <...
2
votes
3answers
5k views

Angular2 Route Interceptor

WARNING: Please see @MgSam's answer for a fatal bug in my original code. He has a revised version that fixes the bug. I have made a route interceptor service that has an API to hook into every event ...
4
votes
0answers
136 views

Simple HTTP router package

I have created a router/micro-framework. I have split my code into multiple files by responsibility. All files are in the same directory. Would you recommend any way of improving it ? The most ...
3
votes
1answer
22 views

Apache2 mod_rewrite directive

The website I'm working on is essentially project-management software. Each project has a code (alphanumeric lowercase, with hyphens). The URL must include the codes and treat them as directories. <...
4
votes
1answer
516 views

.htaccess using public folder and SEO friendly URL

.htaccess is not my strong suit. Is there any there can optimize this code? ...
2
votes
1answer
153 views

Redirecting the web client after deleting an item

In my web-app, it is possible to delete an Item when visiting any of 4 different pages: the Show Item page the Edit Item page the List Items page the List Items in Room page If the visitor uses a ...
3
votes
1answer
332 views

Haskell REST API + PostgreSQL

I'm making some small REST API, which I have never done before. I've got some basic stuff working. Now my job is to add new entities to this, but all my work is reduced to copy-pasting code I have ...
1
vote
1answer
3k views

Router class in PHP

I am building a small and 'simple' PHP framework to see if I can bring my PHP skills to a new level and to review the knowledge I have required during OOP classes and tutorials I've done. Currently, ...
6
votes
1answer
84 views

Web Development DSL

I'm working on a DSL for web development, similar to sinatra. The git repository is here. I've been attempting to improve this code and write it for 4 months, and as a hobby programmer, I would like ...
1
vote
0answers
198 views

Express.js MVC controller router

So in the vein of an old dog trying to learn new tricks, I've decided to try to polish up my JavaScript skills. I've used it a lot but I don't claim expertise. I'm looking for any critique on the ...
-1
votes
1answer
1k views

Protect against XSS with .htaccess file

My .htaccess redirects everything to my index.php, but I wonder if it's vulnerable to XSS attacks. Am I safe? .htaccess file ...
1
vote
0answers
53 views

Matching URIs with regexes for Apache CXF InInterceptor

In my project I need to compare the URI with 15+ regex patterns. Currently I have used a if ladder to execute the appropriate code if any of them gets matched. ...
0
votes
1answer
649 views

Simple PHP CRUD application with Google Maps

I've got some experience with Laravel but for fun I started a small project (basically a CRUD with also Google Maps) without a framework because I considered that is oversized. This is the directory ...