Welcome Guest, Not a member yet? Register   Sign In
html linking not working
#1

HTML Page
**********
<body id="myPage" data-spy="scroll" data-target=".navbar" data-offset="60">
<div class="main-header" id="main-header">
  <nav class="navbar mynav navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
        <a class="navbar-brand" href="#">Baskaran</a> </div>
      <div class="collapse navbar-collapse" id="myNavbar">
        <ul class="nav navbar-nav navbar-right">
          <li class="active"><a href="#banner">Home</a></li>
           <li><a href="#work">About</a></li>
            <li><a href="#edu">Education</a></li>
             <li><a href="#exp">Experience</a></li>
              <li><a href="#res">Research</a></li>
          <li><a href="#award">Award</a></li>
          <li><a href="#testimonials">Testimonial</a></li>
          <li><a href="#portfolio">Portfolio</a></li>
          <li><a href="#contact">Contact Us</a></li>
        </ul>
      </div>
    </div>
  </nav>

all container are single file. I want it to be separate.

like this
******
<li><a href="#work">About</a></li>
            <li><a href="pages/edu.html">Education</a></li>
             <li><a href="pages/exp.html">Experience</a></li>
              <li><a href="pages/res.html">Research</a></li>
          <li><a href="pages/awa.html">Award</a></li>
          <li><a href="pages/tes.html">Testimonial</a></li>
          <li><a href="pages/por.html">Portfolio</a></li>
          <li><a href="pages/con.html">Contact Us</a></li>

when i call index file this URL not working.
this is the html page ,based on this i will call my php projects.
If i am view in the source code , link is working.
what mistake i have done.

Attached Files Thumbnail(s)
   
Reply
#2

Are you using CodeIgniter?

From first guess, pages/por.html won't work in CodeIgniter because of the .html in the end, but if you have Controller Pages.php with method por, then site_url('pages/por') should give you correct working link.
Reply
#3

(07-10-2018, 11:13 PM)Pertti Wrote: Are you using CodeIgniter?

From first guess, pages/por.html won't work in CodeIgniter because of the .html in the end, but if you have Controller Pages.php with method por, then site_url('pages/por') should give you correct working link.

it's a HTML Page . Main page of the my project. thats why
Reply
#4

(07-10-2018, 11:24 PM)kvanaraj Wrote:
(07-10-2018, 11:13 PM)Pertti Wrote: Are you using CodeIgniter?

From first guess, pages/por.html won't work in CodeIgniter because of the .html in the end, but if you have Controller Pages.php with method por, then site_url('pages/por') should give you correct working link.

it's a HTML Page . Main page of the my project. thats why

Why HTML? Use PHP. site_url() won't work on HTML files. And why you're using HTML files? Save all your view files inside './application/views/'.

If I get your point.
Reply
#5

(07-11-2018, 05:39 AM)kaitenz Wrote:
(07-10-2018, 11:24 PM)kvanaraj Wrote:
(07-10-2018, 11:13 PM)Pertti Wrote: Are you using CodeIgniter?

From first guess, pages/por.html won't work in CodeIgniter because of the .html in the end, but if you have Controller Pages.php with method por, then site_url('pages/por') should give you correct working link.

it's a HTML Page . Main page of the my project. thats why

Why HTML? Use PHP. site_url() won't work on HTML files. And why you're using HTML files? Save all your view files inside './application/views/'.

If I get your point.
No. Kaitanz . i know in php codeigniter. But it's a html page .it's a main page of my project
Reply
#6

Where are these html pages located at?

Code:
<head>
 <base href="https://www.yoursite.com/">
</head>

You can then do it like this, base href needs to point to the folder where these pages are located.

Code:
<a href="pages/edu.html">Education</a>

Full link would look like below:

Code:
https://www.yoursite.com/pages/edu.html

It all depends on where these pages are located at.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB