Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Wordpress link to outside resources, top navigation bar

Posted on 2013-06-13
4
Medium Priority
?
882 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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 count occurrences of each item in an array.
Suggested Courses

618 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