Enjoy an ad free experience by logging in. Not a member yet?
Register .
04-18-2011, 01:49 PM
PM User |
#1
New Coder
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
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 ..
04-18-2011, 02:08 PM
PM User |
#2
Senior Coder
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
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:
04-18-2011, 02:16 PM
PM User |
#3
New Coder
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by
teedoff
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
04-18-2011, 02:42 PM
PM User |
#4
Supreme Master coder!
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
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 ..
Users who have thanked abduraooft for this post:
04-18-2011, 02:51 PM
PM User |
#5
Senior Coder
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 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:
04-18-2011, 03:32 PM
PM User |
#6
Senior Coder
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
Quote:
Originally Posted by
eperkins153
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
04-18-2011, 04:35 PM
PM User |
#7
New Coder
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by
abduraooft
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 ..
04-18-2011, 04:38 PM
PM User |
#8
New Coder
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by
abduraooft
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 ?
04-18-2011, 05:00 PM
PM User |
#9
Supreme Master coder!
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
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)
Users who have thanked abduraooft for this post:
04-18-2011, 06:45 PM
PM User |
#10
New Coder
Join Date: Mar 2011
Posts: 11
Thanks: 10
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by
abduraooft
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 ?
04-18-2011, 06:46 PM
PM User |
#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 06:52 PM ..
Jump To Top of Thread
Thread Tools
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
HTML code is Off
All times are GMT +1. The time now is 07:58 AM .
Advertisement
Log in to turn off these ads.