I am having trouble linking from a subfolder index file back to my root folder index file.
I have a logo in the nav bar of example.com/blog that I would like to have link back to example.com
I have tested various linking options for the logo image including
<a href="../index.html">
<a href="http://www.example.com">
<a href="../">
And none of them seem to work. The logo image continues to link to example.com/blog/index.html
The strange thing is that if I right click on the image and then select open in a new window/tab, then it will load example.com just fine.
I am at a complete loss.
Could this be something related to my .htaccess file?
Additional Info
I added a "Home" text link to the nav bar using the below syntax and it works perfectly.
Home
The image for some reason will not link back to the rootfolder index.html file using the same syntax. It keeps loading http://www.example.com/blog/index.html
Try using a javascript redirect
function home() {
window.location.replace("http://example.com");
}
<button onclick="home()">hi</button>
Replace http://example.com with your website.
Related
I've created the side menu bar of my website in a separate html file that uses jquery to import it to my website's pages. I ran into a problem where I have some html files in a separate folder causing the homepage button link to not work due to it being in a different relative file path:
<li>Home</li>
How can I make this href path universal so regardless of the current html file's location, it will always go to my Homepage.htm which is located in the root of my project file.
Maybe really dumb question but I'm building my first site
http://iservis.info/
Im trying to build classic URL structure
I have single page "Opravy" where all devices are listed and if you clicked on certain one i want to have URL "http://iservis.info/opravy/iphone-xs-max.
So on server i have a file "opravy.html" for main page and folder "Opravy" with all sub-pages with certain devices.
enter image description here
I also have .htaccess for all .html extensions
But problem is that in nav-bar I have nav-link "Opravy" and my code is like this
<a href="opravy" class="nav-menu-link--block desktop-only w-inline-block">
But its showing error because I think its trying to link the folder and not the "opravy.html" page.
So how do I link the "opravy.html" page to nav-link but without showing .html in URL ?
Thanks a lot
Maybe use directory structure + index.html? Each index.html is rendered at the corresponding url that matches the directory structure. Something like this:
/
index.html
/../opravy
index.html
/../../iphone-xs-max
index.html
I'm working on a local WordPress setup using MAMP and am unable to get my pages to display new content other than the index.php file.
I currently have two pages: index.php and information.php.
When I click the link in the navigation bar, it redirects me to the information.php page, but the content within that file is not displayed.
I've checked all the usual things (ie. browser cache, permalinks, .htaccess to allow override), but can't seem to make any headway.
Any suggestions would be appreciated! Please let me know if you need to see any additional code as well.
header.php
<a class="dropdown-toggle disabled" data-toggle="dropdown" href="main_hubs/information.php">Information
<span class="caret"></span></a>
information.php and index.php
<?php get_header();?>
**Updated Content Here***
<?php get_footer();?>
Wordpress loads everything on the index.php of your installation and then it uses a routing system.
To be able to use information.php you must add it to your current theme and then add a snippet in the functions.php that makes the relation between a slug of a page to a .php file.
For instance: This code looks for a page that has the slug "information" and if found it will load the information.php file on the theme.
add_filter('page_template', 'my_custom_template');
function my_custom_template($page_template) {
if (is_page('information')) {
$page_template = dirname(__FILE__).'/information.php';
}
return $page_template;
}
This link is also very helpful in how wordpress works with links and slugs:
https://developer.wordpress.org/themes/basics/template-hierarchy/
Go to your wp-admin panel > setting > permalinks choose your links according to your page url which is just below your title of your page. I think this would work if not pls let me know.
I'm working on my site on localhost. I have my directories as follows:
My index page is located directly in the site folder as such:
../htdocs > mysite > index.php
My our-profile page is located in sub-folder called about us as such:
../htdocs > mysite > about-us > our-profile.php
I have a link on the our-profile.php page that should link back to the homepage like this: <a href=..\index.php>Home</a>.
But i keep getting a 404 - Not Found error. It uses the about-us directory as the root. So the link above tries to search for : http://localhost:8888//mysite/about-us/mysite/index.php
instead of
http://localhost:8888//mysite/index.php
How do i re-structure the links?.
EDIT:
I'm working with dreamweaver. Could it be an issue from dreamweaver?
you're using backslashes, use forward slashes
<a href=../index.php>Home</a>.
Say I have a link like this on public_html/index.html:
Link to picture
Since the "link to picture" has its own folder and uses index.html, normally that extension would be hidden if I type in "www.mywebsite.com/pictures". But if I first go to "www.mywebsite.com", then click that link, it would display in the address bar as "www.mywebsite.com/pictures/index.html". How would I hide the "index.html" in links? I've tried this but it doesn't work:
Link to picture <---this simply opens the file directory
Thanks.
Add the following to your httpd.conf file:
DirectoryIndex index.html
And by default if you don't pass in a filename index.html gets rendered instead of the directory content