W
W
WEBIVAN2012-08-13 19:28:04
PHP
WEBIVAN, 2012-08-13 19:28:04

Is it possible to change $_SERVER['REQUEST_URI'] in PHP via .htaccess?

Is it possible to write a rule where, for example, when going to example.com/page , the request was passed to example.com/index.php for processing and in index.php the $_SERVER['REQUEST_URI'] variable was set to /other_page using .htaccess and not php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xaker1, 2012-08-14
@xaker1

The only thing that comes to mind is a construction like this:
.htaccess:
php_value auto_prepend_file "replaceuri.php"
replaceuri.php:
<? $_SERVER['REQUEST_URI'] = 'other_page'; ?>
True, it will only work with mod_php.

N
Nazar Mokrinsky, 2012-08-13
@nazarpc

RewriteEngine On
RewriteRule .* index.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question