Solved

How to get the full http address and querystring from WordPress?

Posted on 2013-01-24
3
472 Views
Last Modified: 2013-01-24
I am trying to get the full http address including any querystrings, from a wordpress page (I am building a WP theme).

None of the $_REQUEST attempts I try work.

Here is the page I am working on: http://www.the1stdistrict.com/blog/final-election-results

Is there a way for me to query WP to get the full address listed above?
0
Comment
Question by:rascal
  • 2
3 Comments
 
LVL 15

Expert Comment

by:Ess Kay
ID: 38815668
<?php
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $url;
?>



http://www.phpeasystep.com/phptu/27.html
0
 
LVL 15

Accepted Solution

by:
Ess Kay earned 500 total points
ID: 38815682
When you run $_SERVER['HTTP_HOST']; you'll get result "www.apple.com" only, no "http://" no "/downloads/dashboard/email_messaging/todo.html"



When you run the script "$_SERVER['REQUEST_URI']" you'll get the result below.
no "http://" and no "www.apple.com

blog/final-election-results



hope that helps
0
 
LVL 1

Author Closing Comment

by:rascal
ID: 38815715
Thanks!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how i fix Remove render-blocking JavaScript 3 60
maybe no no httpd.conf 6 48
google analytics in wordpress 4 35
Email called spam 5 14
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question