473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Mod_rewrite question - does php expose the original url?

Hi All,

Forgive a newbie-ish question here, but I've not been long in the Apache /
PHP world.

I'm just learning about mod_rewrite, and a question occurred to me. Once
Apache has rewritten a url, the php page can (obviously) see the *rewritten*
url and access it via $_GET. But does php have any access to the *original*
url? I'm told that Apache *does* expose both urls (original and rewritten),
it's just a question of whether the php module also exposes both.

Any ideas?

Cheers,

JON
Oct 3 '05 #1
2 2744
Jon Maz wrote:
Hi All,

Forgive a newbie-ish question here, but I've not been long in the Apache /
PHP world.

I'm just learning about mod_rewrite, and a question occurred to me. Once
Apache has rewritten a url, the php page can (obviously) see the *rewritten*
url and access it via $_GET. But does php have any access to the *original*
url? I'm told that Apache *does* expose both urls (original and rewritten),
it's just a question of whether the php module also exposes both.

Any ideas?


PHP can access the requested URI (seen in the browser's address bar) is
in $_SERVER['REQUEST_URI']. AFAIK, there isn't a direct entry of the
target URI (or query string) set in the $_SERVER array...

--
Justin Koivisto, ZCE - ju****@koivi.com
http://koivi.com
Oct 3 '05 #2
Thanks a lot Justin!

JON
Oct 4 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Westcoast Sheri | last post by:
Hello. How do I do this: If a visitor types in any number after my url, I want mod_rewrite to convert it to my url/anotherpage.html?number=number_visitor_typed Example: ...
4
by: Support | last post by:
Hello, I am running RedHat & Apache. RedHat does not allow creating more that 32000 subdirectories in one folder due to #defined constant limitation in the core code. I need to display 47000...
1
by: Shabam | last post by:
In Apache there's a pretty powerful module called mod_rewrite. Is there anything like that in dot net?
6
by: namemattersnot | last post by:
ok. i give up. need help :) here's the rule: RewriteRule ^test/(.+)/(.*)$ /index.php$2 if i request: http://localhost/test/keyword/?show=files it properly redirects me. NOW, if i change...
11
by: joelbyrd | last post by:
I have a people-networking type site in which each user has their own profile page, with their user id encoded. So, for example, the web address of their page might look like...
2
by: jaanus | last post by:
Here we go... What I have been trying to do is to forward all http requests containing /cms/ to http://cms.mydomain.com/ example1: http://host1.mydomain.com/cms/init.php would be parsed from...
0
by: EA Durbin | last post by:
I have enabled mod_rewrite on my server and it successfully rewrites URL's and works nicely, but then it logs the URL to be rewritten as "File does not exist" .... in the error log My http.conf...
11
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
With Apache's mod_rewrite module I can keep *.php files and load them as *.html files: # Make http//example.com/foo/bar.html load /home/site/foo/bar.php RewriteEngine On RewriteRule...
7
by: Dale | last post by:
again, i know this is OT...just move along to the next post if it bugs you. :) i had been trying to have this: project.66.204.32.110 from the client browser, map to a virtual host where the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.