Solved

Wordpress link to outside resources, top navigation bar

Posted on 2013-06-13
4
829 Views
Last Modified: 2013-06-14
I recently installed Wordpress on my Linux server and I'm using a standard template. To add a link on the navigation bar in my Wordpress home page just below the header image, I think that adding a new page is required: in this way the new link appears in the horizontal navigation bar at the top of the page.

The Wordpress permalink for my new page looks like this: http://www.mywordpress.com/?page_id=16
But I don't need to add content - I simply need to add a link to https://site.mydomain.com/path/script.cgi
and the link needs to be in my Wordpress navigation bar.

I tried apache rewrite but this failed to make any difference:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mywordpress\.com\/?page_id=16 [NC]
RewriteRule (.*) https://site.mydomain.com/path/script.cgi [L,R=301]

Since I would only need to redirect a single page, I read in one of your archives that the file to edit is
~/wordpress/wp-content/themes/name_of_theme/page.php
so I changed this:
<?php get_header(); ?>
to
<?php if (is_page( 16 ) header("Location:/https://site.mydomain.com/path/script.cgi/")) get_header(); ?>

and now I get a blank page when I navigate to the link - the url still shows http://www.mywordpress.com/?page_id=16 but now Apache doesn't know what to look for. Let me know how to fix this thanks.
0
Comment
Question by:sara_bellum
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
tailoreddigital earned 500 total points
ID: 39246515
I'm either completely misunderstanding or you are making this out to be harder than you think.

From what i understand,

go to appearance/menu  and add a Custom Link to the menu,
Custom LinkIn the Theme Locations section, be sure to choose which menu you are using.
0
 

Author Comment

by:sara_bellum
ID: 39246638
Thanks very much!! It's always such a relief to find the answer (I did make it more complicated, I have a harder time with GUIs than most :-(

Another reason I got confused was that I had first tried to put the cgi script under the same doc root as my wordpress site, to keep a consistent site url.  I have two other apache virtual hosts running cgi scripts but on the virtual host running wordpress, when my browser loads a script in the directory path configured for ExecCGI, the script is displayed as text.  

The only thing I can think of is that Apache may not recognize the ExecCGI directory path in the same way that it does on non-wordpress virtual hosts:
doc-root# ls -l
  dir css
  dir images
  dir scripts <-- ExecCGI enabled but scripts appear as text
  index.php
  robots.txt
  symbolic link to /usr/share/wordpress

That being said, you did answer my question. I'll check back tomorrow, let me know if I should open a new one thanks.
0
 
LVL 23

Expert Comment

by:tailoreddigital
ID: 39246715
I'm glad i posted, i was really second guessing whether or not i should post.  I just felt like i must be overlooking something in the question.   I'm glad we have a solution.
0
 

Author Closing Comment

by:sara_bellum
ID: 39249253
Enough about my  other questions...staying focused...
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now