?
Solved

Wordpress link to outside resources, top navigation bar

Posted on 2013-06-13
4
Medium Priority
?
871 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
tailoreddigital earned 2000 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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 dynamically set the form action using jQuery.
Suggested Courses

771 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