0

Say I'm trying to access:

mysite.com/foo/bar/

I want too:

RewriteEngine On
RewriteCond %{REQUEST_URI} !=/index.php
RewriteRule .* /index.php

Then:

$url = $_SERVER['PHP_SELF'];
echo $url;

To show:

foo/bar/

Currently getting:

index.php

(Obviously I have no idea, but you get the point for what I'm trying to achieve)

1 Answer 1

2

Use $_SERVER['REQUEST_URI']

http://php.net/manual/en/reserved.variables.server.php

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.