[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 893
  • Last Modified:

Wordpress link to outside resources, top navigation bar

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
sara_bellum
Asked:
sara_bellum
  • 2
  • 2
1 Solution
 
tailoreddigitalCommented:
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
 
sara_bellumAuthor Commented:
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
 
tailoreddigitalCommented:
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
 
sara_bellumAuthor Commented:
Enough about my  other questions...staying focused...
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now