Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-18-2011, 01:49 PM   PM User | #1
eperkins153
New Coder

 
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
eperkins153 is an unknown quantity at this point
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 02:24 PM..
eperkins153 is offline   Reply With Quote
Old 04-18-2011, 02:08 PM   PM User | #2
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
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
teedoff is offline   Reply With Quote
Users who have thanked teedoff for this post:
eperkins153 (04-18-2011)
Old 04-18-2011, 02:16 PM   PM User | #3
eperkins153
New Coder

 
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
eperkins153 is an unknown quantity at this point
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
eperkins153 is offline   Reply With Quote
Old 04-18-2011, 02:42 PM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
<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?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

Last edited by abduraooft; 04-18-2011 at 02:57 PM..
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
eperkins153 (04-18-2011)
Old 04-18-2011, 02:51 PM   PM User | #5
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
it's referred to as url-rewriting. here is an example for apache servers - http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
DanInMa is offline   Reply With Quote
Users who have thanked DanInMa for this post:
eperkins153 (04-18-2011)
Old 04-18-2011, 03:32 PM   PM User | #6
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
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
teedoff is offline   Reply With Quote
Old 04-18-2011, 04:35 PM   PM User | #7
eperkins153
New Coder

 
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
eperkins153 is an unknown quantity at this point
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 04:48 PM..
eperkins153 is offline   Reply With Quote
Old 04-18-2011, 04:38 PM   PM User | #8
eperkins153
New Coder

 
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
eperkins153 is an unknown quantity at this point
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 ?
eperkins153 is offline   Reply With Quote
Old 04-18-2011, 05:00 PM   PM User | #9
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
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.
Quote:
<a href="index.html" class="">Home</a>
You just need href="/" there.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
eperkins153 (04-18-2011)
Old 04-18-2011, 06:45 PM   PM User | #10
eperkins153
New Coder

 
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
eperkins153 is an unknown quantity at this point
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 ?
eperkins153 is offline   Reply With Quote
Old 04-18-2011, 06:46 PM   PM User | #11
eperkins153
New Coder

 
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
eperkins153 is an unknown quantity at this point
I really appreciate your help, thank you

Last edited by eperkins153; 04-18-2011 at 06:52 PM..
eperkins153 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:58 AM.


Advertisement
Log in to turn off these ads.