Questions tagged [request-uri]

The Request-URI is a Uniform Resource Identifier to identify the resource upon which the request should be applied.

There are 4 types of options available for the request uri depending on the nature of the request -

  • "*" = request does not apply to a particular resource
  • absoluteURI = when the request is being made to a proxy
  • abs_path = to identify a resource on an origin server or gateway.
  • authority = only used by the CONNECT method
101 questions
1
vote
1 answer

How to use Regex on Apache REQUEST_URI?

Currently using Apache 2.4 with SSI Legacy Parser On and trying to use Regex code to obtain the results I am looking for. The example result I get from the above code…
SteveL
  • 77
  • 9
1
vote
2 answers

REQUEST_URI is populated with default-file (DirectoryIndex) /index.html

After a migration to a new server with Centos some behaviour changed. The environment-variable REQUEST_URI contains '/index.html' when http://example.com is fetched (without the index.html). I would expect: REQUEST_URI is '/' when…
1
vote
0 answers

$_SERVER["REQUEST_URI"] randomly empty after htaccess redirect

When a user try to visit a file which doesn't exist, I use a .htaccess redirect to 404.php which saves the wrong URL of the missing file into database. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) /404.php…
Koralek M.
  • 3,231
  • 4
  • 26
  • 32
1
vote
2 answers

How to check if url is the homepage

Found this answer If url is the homepage (/ or index.php) do this which was really helpful however doesn't fully answer my question. I have an index of site for school that shows all my folders to different assignments. so my homepage is actually…
Parzi
  • 694
  • 2
  • 10
  • 33
1
vote
1 answer

.htaccess Pretty URLs - PHP $_SERVER['REQUEST_URI'] being overwritten without $_SERVER['REDIRECT_REQUEST_URI'] avalible

.htaccess Options +FollowSymlinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^cars/(.*).html$ /control.php [P,L] RewriteRule ^trucks/(.*).html$ /control.php [P,L] /control.php

        
Pseudo
  • 31
  • 4
1
vote
0 answers

What is the maximum length of $_SERVER['REQUEST_URI']?

I was wondering if there is a limit to $_SERVER['REQUEST_URI'] itself since there seems to be no limit on storing string in a variable (php7). See this answer So, if a user can somehow request using a very very large url (I know there are browser…
Abdul Muiz
  • 111
  • 3
  • 7
1
vote
2 answers

class within an div using php echo

Just basically want to know if its possible adding an class to my div which i echo using an if statement. My code: $currentpage = $_SERVER['REQUEST_URI']; if ($currentpage == "/room/penthouse-suite/"){ echo "
Ylama
  • 2,449
  • 2
  • 25
  • 50
1
vote
0 answers

Post value $_SERVER['REQUEST_URI'] 403 Forbidden

hi im trying to set up my website. Initial php works very vell. I can get select value from db. When i click submit button im getting Forbidden You don't have permission to access / on this server. error. Submit button usses POST…
Furkan
  • 141
  • 1
  • 13
1
vote
0 answers

How to retrieve script name using $_SERVER['REQUEST_URI']?

I am using Object Oriented PHP for a project which I am developing on my local system. Path to the project in my system is : localhost/ecommerce/ I am retrieving the file name using $_SERVER['REQUEST_URI'] which gives me the output : $uri =…
Yomesh
  • 288
  • 1
  • 4
  • 19
1
vote
1 answer

Insert value to URL path

I have a site with content that is different for market locations, so I am setting a cookie for the users location. If a user tries going to a landing page directly I would like to insert the market location to the URL. For example, if a user tries…
Robert
  • 143
  • 14
1
vote
1 answer

htaccess and php_self dont work in same page

So then I using php_self and press next button i go to index.php, but i want to stay in my clicked page. So my .htaccess now looking this: RewriteEngine On RewriteBase /svetaine/ RewriteCond %{REQUEST_URI}…
Nekasas
  • 47
  • 9
1
vote
3 answers

Get current page name with PHP and jQuery AJAX

I want to log the referer and landing page for visitors to a site. Here's the basic set up: In my index.html file I include my javascript file: . From here I use an AJAX call to a PHP file to get the referer and…
MP_Webby
  • 916
  • 1
  • 11
  • 35
1
vote
1 answer

How to get active tab url from browser?

How do I get URL from current tab in browser using python? Using os.environ['REQUEST_URI'] gives an error. The following is my code : os.environ['REQUEST_URI'] and the error : Traceback (most recent call last): File "", line 1, in…
1
vote
3 answers

using php inside of iframe html tags

I am trying to create a website that displays another website in an iframe. This is my code: HTML with PHP