...

View Full Version : How Do I Prevent My Entire URL From Displaying ? And Make Only The Directory Show ?



eperkins153
04-18-2011, 02:49 PM
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

teedoff
04-18-2011, 03:08 PM
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.

eperkins153
04-18-2011, 03:16 PM
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

abduraooft
04-18-2011, 03:42 PM
<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

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?

DanInMa
04-18-2011, 03:51 PM
it's referred to as url-rewriting. here is an example for apache servers - http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

teedoff
04-18-2011, 04:32 PM
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.

eperkins153
04-18-2011, 05:35 PM
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

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.

eperkins153
04-18-2011, 05:38 PM
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

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 ?

abduraooft
04-18-2011, 06:00 PM
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.

eperkins153
04-18-2011, 07:45 PM
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
04-18-2011, 07:46 PM
I really appreciate your help, thank you



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum