Solved

Need help with re-structuring my URL for SEO

Posted on 2008-11-02
13
314 Views
Last Modified: 2012-05-05
Hi...
I am wanting change my current URL structure of my website from:

http://www.mydomainname.com

to:
http://www.mydomainname.com/foldername

I am obviously doing this because I want to add keyword(s) for SEO purposes.

I have already modified the htaccess file to redirect 301  - http://mydomainname.com to http://www.mydomainname.com
I was able to mod the htaccess file from a posting that I found on the web...personally...I have NO skill or understanding how to write this entry on my own....

Anyway, can anyone show me how to mod the htaccess file to point the default index.htm file to a sub-folder I created on the web-server? I am not even sure I am asking this question correctly....

Thanks,
Matt
0
Comment
Question by:Matt_Mercurio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 12

Expert Comment

by:ShaneJones
ID: 22865346
Sure thing, add the following code to your htaccess file

This will redirect http://www.domain.com/index.html to http://www.domain.com/

and http://www.domain.com/folder/index.html to http://www.domain.com/folder/

and so on!



RewriteEngine On
RewriteCond %{THE_REQUEST} /index\.html [NC]
RewriteRule ^(.*/)?index\.html$ /$1 [R=301,L]

Open in new window

0
 
LVL 12

Expert Comment

by:ShaneJones
ID: 22865351
oh I have this live on my site, you can test it here http://www.shanedj.com/index.php and here http://www.shanedj.com/blog/index.php

I have php files on my site and have modified the above code for you html versions
0
 

Author Comment

by:Matt_Mercurio
ID: 22866390
Thanks Shane...

One question...where exactly do I change your code to reflect my "myfoldername/index.htm"?

Thanks,
Matt
0
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 
LVL 12

Expert Comment

by:ShaneJones
ID: 22866417
it automatically works on folders and sub folders. see my example above that shows the blog folder on my site.

That code that I posted is running on my site.

Apply the code to your sites htaccess and try the folders with index.html they will redirect to the root.

Shane
0
 

Author Comment

by:Matt_Mercurio
ID: 22866495
oh ok...wait a sec...I think I am asking the question wrong then...

Here is what I want to do...

When someone types my address in their web browser:
www.domainname.com

I want it automatically to go to:

www.domainname.com/foldername.

I have created the sub folder and I have already placed all the necessary files within it...

Thanks,
Matt
0
 
LVL 12

Expert Comment

by:ShaneJones
ID: 22866550
In your htaccess

Redirect 301 www.domain.com/ "http://www.domain.com/folder/"

I would also recommend putting them other lines in your htaccess too

Shane
0
 

Author Comment

by:Matt_Mercurio
ID: 22866658
I am sorry to be a pain Shane...I must be doing something wrong....

I put that line in my htaccess file exactly as you have it written and it is still not working....

I type in my sites addy and it keeps taking me to: http://www.domainname.com without the "foldername."

What I am trying to accomplish is placing my keyword in the URL so the search engines will judge me accordingly. For example, http://www.domainname.com/keyword

Thanks again,
Matt
0
 
LVL 12

Accepted Solution

by:
ShaneJones earned 500 total points
ID: 22866725
I see what you are trying to although I wouldn't get too hung up about redirecting your homepage away.

I am an SEO Professional and what you are doing will not make a difference. It would be more powerful if you had the keyword in your Title, H1 supporting h2 to h6 where necessary, meta description and to cover all bases the meta keywords. Also include about 250+ words of text on the page that is about the keyword.

The homepage is yoru most important page. Redirecting away from it is not advisable in my eyes. From an SEO perspective

From an Apache perspective you need this code

Redirect 301 /index.html "http://www.domain.com/folder/"

have just tested this and it work redirecting from www.domain.com

Shane
0
 
LVL 12

Expert Comment

by:ShaneJones
ID: 22867316
Hi Matt,

Did this solution work for you?

Shane
0
 

Author Comment

by:Matt_Mercurio
ID: 22871964
Sorry Shane...I have been away from my PC since early this morning...I've been in meetings allllllllllllllllllllll daaaaaaaaaaaaaaaaay   urghhhhhh

anyway, let me get at the solution you provided.....stand by I will test later tonight and get back to you...

Again Thanks!
Matt
0
 

Author Comment

by:Matt_Mercurio
ID: 22875745
Shane...it worked! Thank you!

one last question...you said earlier that putting the keyword in the url structure would not make that much difference and that it is better to sprinkle it throughout the title, h1, h2, meta data, etc...and I realize that it may not yeild much in terms of positioning....however, does it have any NEGATIVE  impact? if not, then why not go ahead and put it in the url in addition to all the normal placements?

Thanks again,
Matt
0
 
LVL 12

Expert Comment

by:ShaneJones
ID: 22875936
Glad to see it worked for you. You can close the question and add the correct answer to the knowledge base

Not sure about a negative impact but your homepage domain.com for instance is your most powerful page. Redirecting away is not advised really. On deeper pages and folder structures it is advisable to include the keyword yes a keywordeed folder name is better than a random folder name. But I am against redirecting away from the homepage.

If you have any more questions you can ask them in the SEO section :) I'll be glad to help and am normally on this all day.

Cheers

Shane
0
 

Author Closing Comment

by:Matt_Mercurio
ID: 31512561
Thank you!
0

Featured Post

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
SEO can be a real minefield to navigate, but there are three simple ways to up your SEO game just be re-assessing your content output.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question