0

I have a static site with a few pages and an installation of Wordpress. I uploaded wordpress to the server and I am able to access it from any of the static pages using the link href="blog\". The static html pages are stored in the main directory of the server which is also where the blog is stored. the directory looks like this:

public_html/   //Server directory
-index.html
-contact.html
-about.html
-blog/         //Folder with blog installation
--wp-content/
---themes/
----theme_name/ 
-----file_with_links.php

Im trying to put links in the php file "file_with_links.php" that will link back to the static html pages which are a few directories up from it. I tried to do use ../../../../../page.html with no luck. Is there an easy way to do this? any help would be appreciated.

-Thanks

4

1 回答 1

0

最佳做法是使用完整的 URI ( http://YourSiteHere.com/YourFileHere.html)。

为此,请在您的file_with_links.php文件中使用以下代码:

$root_toot = "http://YourSiteHere.com";

$to_contact = '<a href="' . $root_toot . '/contact.html">Contact</a>';
$to_about = '<a href="' . $root_toot . '/about.html">About</a>';

等等。

于 2013-09-18T03:32:58.990 回答