How Do I Eliminate Sub Folder From URL

New to mod_rewrite? This is a good place to start.

Postby richardk » Sat Oct 10, 2009 9:57 am

Right that worked with the text in my opening statment, but still when I go through the Navigation Bar Links the folders remain in the URL.

Because you haven't edited those links. You have to change all the links.

I feel like giving up, Is this really worth all the hastle I am thinking

In my opinion, it isn't. (But i will still help if you want to do it.)

I really want my site seo friendly

Some people think keywords in the URL are better for SEO.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby helpvid » Sat Oct 10, 2009 10:05 am

Ye man it worked, when I looked this morning everything was working fine, no folder or sub folder in the URL. I changed all the links last night but must have required a little time, so it's all good now thanks to you.

I really do appreciate your help as there is so much garbage out there, kids talking about stuff they no nothing about.

I wanted to ask you a Question, does the html file "name" effect seo or page rank. If so what is the best method from bellow.

this_is_my_file.html

this-is-my-file.html

or

ThisIsMyFile.html

Just wondering if the actual name effects anything....

Yes I think seo is a good thing, but not if it's going to take you away from waht should be your main focus, your actual website.

Thanks Again.
Mark
helpvid
 
Posts: 15
Joined: Thu Oct 08, 2009 2:17 pm

Postby richardk » Sat Oct 10, 2009 10:15 am

I changed all the links last night

For me, there are still links that contain the sub directories, for example the "letters" menu at the bottom of the index page.

I wanted to ask you a Question, does the html file "name" effect seo or page rank. If so what is the best method from bellow.

this_is_my_file.html

this-is-my-file.html

or

ThisIsMyFile.html

I have no idea which is better or if it even matters at all, most SEO facts are just speculation anyway.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby helpvid » Sat Oct 10, 2009 1:44 pm

Now is there a way I can remove the .html

I have seen many sites with Example mysite.com/myfile/

So no .html extension.....
helpvid
 
Posts: 15
Joined: Thu Oct 08, 2009 2:17 pm

Postby richardk » Sat Oct 10, 2009 1:53 pm

Try
Code: Select all
# Check if the file exists in /tutorials/dreamweaver with .html extension.
RewriteCond %{DOCUMENT_ROOT}/tutorials/dreamweaver/$1.html -f
RewriteRule ^([^/]+)/?$ /tutorials/dreamweaver/$1.html [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby helpvid » Sat Oct 10, 2009 2:10 pm

I was getting the 404 error when I tried that. Is it the case that I will need to also go into the background and remove all the .html extensions from the HTML Code in Dreamweaver. Much like I did with the folder Issue.
helpvid
 
Posts: 15
Joined: Thu Oct 08, 2009 2:17 pm

Postby richardk » Sun Oct 11, 2009 11:42 am

I was getting the 404 error when I tried that.

You got a 404 error when you visited /divtag/?

Is it the case that I will need to also go into the background and remove all the .html extensions from the HTML Code in Dreamweaver. Much like I did with the folder Issue.

Yes. You always have to change the links. Mod_rewrite does not change your HTML.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby helpvid » Sun Oct 11, 2009 11:51 am

yes it works, man i got a lot of work to do taking all those evtensions away, but watch this space.

Thank you so much, Everything you have said works, webmaster
helpvid
 
Posts: 15
Joined: Thu Oct 08, 2009 2:17 pm

Postby helpvid » Sun Oct 11, 2009 12:02 pm

Before i start does it matter if I end with the forward slash/
helpvid
 
Posts: 15
Joined: Thu Oct 08, 2009 2:17 pm

Postby helpvid » Sun Oct 11, 2009 1:22 pm

So now when any one goes to a dreamweaver, Photoshop, Flash or After Effects particular tutorial their folder and the .html has been removed.

Can you do me a bit of code so I can remove the .html from top level, like index.html, tutorials.html, infromation.html, aboutme.html and contact.html.

I would only need one example and I could amend for the others as they are all on the same level.

Mark
helpvid
 
Posts: 15
Joined: Thu Oct 08, 2009 2:17 pm

PreviousNext

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 10 guests

cron