Questions tagged [pathinfo]
85 questions
3
votes
0 answers
Can't get Apache-like multiviews functionality in nginx
I've been trying for a few days to get apache-style multiviews working with path_info with no luck. I'm using nginx/1.2.1 and php5-fpm 2.4.0. My goal is to be able to visit example.com/product/48/my-product-name where product translates to…

Jason Woodland
- 478
- 2
- 7
- 14
3
votes
3 answers
NGINX configuration. PHP frameworks with PATHINFO 404
I usually use apache and want to give NGINX a try.
I have installed it on my ubuntu dev machine and have a few different frameworks and sites set up and in development (codeigniter, symfony, laravel, etc).
The problem I'm getting is that only paths…

Atrox1449
- 101
- 3
- 8
2
votes
2 answers
Check in PHP if PATH_INFO is enabled on your server?
From PHP, is there a cross-platform, cross-web server way of determining if PATH_INFO is enabled on the server you are running on?
It appears $_SERVER['PATH_INFO'] is only populated if there are extra path segments after the script, so you can't…

Brad Bell
- 368
- 1
- 11
- 27
2
votes
1 answer
HTML link concatenating the 'href' content to existing URL
So far, I've been using GET parameters to route between the pages of my website (hosted on the server of my university). I'd like to make use of $_SERVER["PATH_INFO"] instead as it's, I guess, a cleaner way to route between pages.
I'd like to go…

Tom Clabault
- 481
- 4
- 18
2
votes
4 answers
Return PHP page based on directory base-name without redirect
I want the server to return a specific PHP page based on the directory name without a redirect. For example:
http://www.example.com/home
should return the same result as:
http://www.example.com/index.php?page=home
but it shouldn't redirect the…

yankygo
- 25
- 1
- 6
2
votes
3 answers
How do I get css links to resolve correctly when adding a PathInfo value?
I have an asp.net 3.5 app. when I try to add a value to the url to be picked up in Request.PathInfo, i lose anything linked in head because the locations are resolved as relative paths.
master page looks like this:
…

lincolnk
- 11,218
- 4
- 40
- 61
2
votes
1 answer
Symfony2 get path info of URL explicitely
Say, I have an URL http://server/mysite/web/app_dev.php/resource/1.
I am doing a GET request and the corresponding action is ResourceController::getAction.
In this controller action if I call $request->getPathInfo(), it gives me /resource/1.
But in…

Samiron
- 5,169
- 2
- 28
- 55
2
votes
3 answers
Issues with relative/absolute path
I've searched ways to do it so it would work but none of them seemed to work for all paths, so I was wondering if you could give me a direction on how to do this:
This is the structure:
Home Directoy
config.php
index.php
includes/
…

Everett
- 35
- 4
2
votes
2 answers
How to fix this router class to include 404 errors/pages?
I'm working on a simple router for php practice, it's already evolved quite a bit more but I'm posting the more simplistic version.
My router class check a given url vs the current server path and returns content if they match. This works fine but…

Stephan-v
- 19,255
- 31
- 115
- 201
2
votes
0 answers
REAL basename vs PHP basename (pathinfo)
I've got for example a watermark file: ROOT.'/media/watermarks/1.jpg'.
In the future user can use (in some custom php template system) for example: 'watermark-filename', 'watermark-basename', , 'watermark-directory', etc to get needed data.
I'm…

Jacek Kowalewski
- 2,761
- 2
- 23
- 36
2
votes
1 answer
mod_rewrite or path_info for clean URLs
I have always used mod_rewrite for creating clean looking URLs, until recently I didn’t know there was any other option. A few weeks back someone on here pointed out that exactly the same effect can be achieved using apache PATH_INFO. Thinking about…

robjmills
- 18,438
- 15
- 77
- 121
1
vote
2 answers
PHP pathinfo as image attribute not working on server
I'm using the following code to scan a folder for images:

brunn
- 1,323
- 2
- 17
- 37
1
vote
1 answer
Get Only File Name With Extension From URL Not Folder Directory Name In PHP
I want to get the filename with an extension from the current URL using PHP. FOr this problem, there are many codes available online but none of those is covering my need till now. Here is the topmost used code that is still not giving me my…

Muhammad Hassan
- 1,224
- 5
- 31
- 51
1
vote
2 answers
Rewrite everything to be after index.php/
I'm setting up a php mvc framework and I want to redirect anything after the domain to index.php/$1 but it's not working. I have rewrite_module enabled and AllowOverride All, is there something else I'm missing?
Basically I want the url to go from…

bflemi3
- 6,698
- 20
- 88
- 155
1
vote
1 answer
How to make pathinfo() return the right extension?
$path = 'abc.jpeg';
$info = pathinfo($path,PATHINFO_EXTENSION);
echo $info['extension'];
This is returning 'j' for some reason, instead of 'jpeg'
Is there anything I should do before calling pathinfo() ?

HappyDeveloper
- 12,480
- 22
- 82
- 117