Comments (5)
Hi Jack,
You could try this.
- Place all the phprouter files (so also the .htaccess file) in your subfolder
- Edit the router.php file accordingly:
comment out this line
// $request_url = filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);
replace it with
// start add
$thisPart = explode(basename(getcwd()), $_SERVER['REQUEST_URI']);
$fromSubBase = (isset($thisPart[1])) ? $thisPart[1] : $thisPart[0];
$request_url = filter_var($fromSubBase, FILTER_SANITIZE_URL);
// end add
from main.
Hi @madanielecd, I have tried your solution to make it part of the router, though it does not work. Can you please let me know how you expect this to be used?
from main.
Hi @phprouter,
Well I'm not sure, but could it be server config dependant? Is your (Apache) server not responding to the .htaccess in a subfolder?
And fe on nginx it won't work because there is no .htaccess support.
from main.
Maybe this works:
from main.
PhpRouter is intended to be used directly under the root/domain folder.
from main.
Related Issues (20)
- Files downloading from page driven by PHP router. HOT 2
- Error 500 on subdomain. HOT 1
- phprouter works with subfolder in XAMMP but not in LAMP! HOT 4
- Why css file not working HOT 2
- group
- post method not working HOT 1
- Redundant Code HOT 3
- Awesome router HOT 2
- Keeps redirecting to 404 page HOT 2
- optional params HOT 1
- Working in cpanel, not in my PC[ubuntu] HOT 3
- render index and 404 always in the end HOT 1
- .htaccess provided causes infinite loop in cloudflare HOT 1
- Problems with curl and certificates. HOT 1
- $_SESSION doesn't work HOT 1
- Query strings with multiple values HOT 2
- More documentation
- UTM tags and other option or unknown parameters HOT 1
- what if we want this library to use in an single project so we done have to put the files under the htdocs folder ? HOT 1
- PHP Jesus
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from main.