Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Mar 2011
    Posts
    11
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Question How Do I Prevent My Entire URL From Displaying ? And Make Only The Directory Show ?

    I have a website that I built in dreamweaver and is hosted on justhost.com i want my url to display only the directory like this:

    www.perkinscomputerrepair.com/security/

    but instead it displays

    http://perkinscomputerrepair.com/Security/index.html

    I read multiple articles that stated if I simply changed my main html file in the directory to index that it would only display the directory but all my pages still display


    http://perkinscomputerrepair.com/Security/index.html


    instead of

    url]http://perkinscomputerrepair.com/Security/[/url]

    which is what I want, If anyone could tell me what I need to do to make my website do this it would be greatly appreciated. again I'm using dreamweaver to do my coding and my website is hosted on justhost.com
    Last edited by eperkins153; 04-18-2011 at 03:24 PM.

  • #2
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    http://www.mywebsite.com/directory/index.html

    When I click on this link you gave me, I only see www.mywebsite.com/
    in the browser window.

    Not sure if thats what you're wanting, but it doesn't show the directory folder or the page name.
    Teed

  • Users who have thanked teedoff for this post:

    eperkins153 (04-18-2011)

  • #3
    New Coder
    Join Date
    Mar 2011
    Posts
    11
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by teedoff View Post
    http://www.mywebsite.com/directory/index.html

    When I click on this link you gave me, I only see www.mywebsite.com/
    in the browser window.

    Not sure if thats what you're wanting, but it doesn't show the directory folder or the page name.

    That was a just an example link not my actually website address, i just wanted to give an example of what I'm trying to do, I'm sorry for the confusion

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    <ul class="MenuBarHorizontal" id="MenuBar1">
    <li><a href="index.html">Home</a></li>
    <li><a href="SystemTuneUp/index.html" tabindex="-1" class="">System Tune Up</a></li>
    <li><a href="VirusRemoval/index.html" tabindex="-1" class="">Virus Removal</a></li>
    <li><a href="DataRecovery/index.html" tabindex="-1">Data Recovery</a></li>
    <li><a href="Internet/index.html" tabindex="-1" class="">Internet Problems</a></li>
    <li><a href="ComputerTraining/index.html" tabindex="-1">Computer Training</a></li>
    <li><a href="Installation/index.html" tabindex="-1">Hardware Installation</a></li>
    <li><a href="Security/index.html" tabindex="-1">Data Security </a></li>
    </ul>
    All the links in your site points to index.html file in respective folders. Change them all like href="Security/" . Then, to prevent anyone from accessing the urls with index.html, you may add some rules in an .htaccess file, like
    Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{THE_REQUEST} \/index.html\ HTTP [NC]
    RewriteRule (.*)index.html$ /$1 [R=301,L]
    PS: Have you hard-coded all the links in your navigation in every pages?
    Last edited by abduraooft; 04-18-2011 at 03:57 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    eperkins153 (04-18-2011)

  • #5
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    it's referred to as url-rewriting. here is an example for apache servers - http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

  • Users who have thanked DanInMa for this post:

    eperkins153 (04-18-2011)

  • #6
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Quote Originally Posted by eperkins153 View Post
    That was a just an example link not my actually website address, i just wanted to give an example of what I'm trying to do, I'm sorry for the confusion
    lol ahh you're right....too early in the morning for me to be commenting on here.
    Teed

  • #7
    New Coder
    Join Date
    Mar 2011
    Posts
    11
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    All the links in your site points to index.html file in respective folders. Change them all like href="Security/" . Then, to prevent anyone from accessing the urls with index.html, you may add some rules in an .htaccess file, like
    Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{THE_REQUEST} \/index.html\ HTTP [NC]
    RewriteRule (.*)index.html$ /$1 [R=301,L]
    PS: Have you hard-coded all the links in your navigation in every pages?
    thank you so much, It finally works.
    Last edited by eperkins153; 04-18-2011 at 05:48 PM.

  • #8
    New Coder
    Join Date
    Mar 2011
    Posts
    11
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Question

    Quote Originally Posted by abduraooft View Post
    All the links in your site points to index.html file in respective folders. Change them all like href="Security/" . Then, to prevent anyone from accessing the urls with index.html, you may add some rules in an .htaccess file, like
    Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{THE_REQUEST} \/index.html\ HTTP [NC]
    RewriteRule (.*)index.html$ /$1 [R=301,L]
    PS: Have you hard-coded all the links in your navigation in every pages?
    Does this have a negative effect on SEO ?

  • #9
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Does this have a negative effect on SEO ?
    Nothing! R=301 is for a permanent rewrite and the search engines will automatically update any previously indexed urls.
    <a href="index.html" class="">Home</a>
    You just need href="/" there.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    eperkins153 (04-18-2011)

  • #10
    New Coder
    Join Date
    Mar 2011
    Posts
    11
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    Nothing! R=301 is for a permanent rewrite and the search engines will automatically update any previously indexed urls.

    You just need href="/" there.
    I really appreciate you helping me fix this problem, it seems to be working the way I want it too now thank you,

    Can you tell me what you mean by R = 301 ?

  • #11
    New Coder
    Join Date
    Mar 2011
    Posts
    11
    Thanks
    10
    Thanked 0 Times in 0 Posts
    I really appreciate your help, thank you
    Last edited by eperkins153; 04-18-2011 at 07:52 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •