Link to home
Start Free TrialLog in
Avatar of fourice
fouriceFlag for Netherlands

asked on

htaccess solution for SEO friendly urls

Avatar of kmcghee
kmcghee
Flag of Afghanistan image

If you put the demo, store and blog directories in your htdocs directory they will be as you describe.

www.example.com/demo
www.example.com/blog
www.example.com/store

Maybe I didn't understand the problem correctly?
SOLUTION
Avatar of Ahmed Merghani
Ahmed Merghani
Flag of Sudan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fourice

ASKER

Hi kmcghee,

Yes, I know. But this is not what I meant.

There should not be any subfolders. These urls are more userfriendly than for example
www.example.com/index.php?page=demo&subpage=store etc.

Hope that it is more clear now, if not let me know.
What do these URL's actually point to. If

www.example.com/demo/store/category/product

Do these URL's exist or do you you need to rewrite them to use a script?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just curious... Can anyone verify whether this matters at all for SEO any more?  I think Google has changed its algorithms to rely less on the URL and more on the content of the page.  While it may be easier for people to remember these rewritten URLs, I don't think it will do much of anything for page rank.
I agree with Ray, about going to so much extra trouble for a web addy SEO, if you have crappy content, your web addy SEO will not move you up the search page list, if you have great page content that many people see (hits) you move up the search page.
@Ray and Slick812 - yes and no. Google has said that if you have scripted pages keep them they will index them but warns that you should keep the number of parameters short as not all spiders are as adept at spidering as google.

The other consideration with a SEF Url is that you can put keywords into the path so

www.somesite.com/category/rings/trilogy-diamond-ring.html will inevitably be slightly more advantageous than

www.somesite.com/index.php?category=1&product=231

Having said that I am part of those that resent having to build websites around search engines instead of around the people who use them or at least waste valuable time on the former at the expense of the latter.
To do it we need a far more precise definition of what you want. My guess...

Your controlling php file is index.php

It accepts the following URL parameters page, subpage, subsubpage, subsubsubpage

e.g.

index.php?page=xxxx&subpage=yyyy&subsubpage=xxxx

parameters are optional apart from page and dependent on the fact the previous parameter exists.

The rewritten URL should be in the forms:

 /page
 /[subpage]/page
 /[subsubpage]/[subpage]/page
 /[subsubsubpage]/[subsubpage]/[subpage]/page

This is just an educated guess on the information you have provide.

Please tell us exactly what you actually want. Then it will be possible to construct code to do it.
Avatar of fourice

ASKER

Sorry for the late response.

I accepted multiple replies as an answer, but fourck's answer got me the best on the way. I'm not completely there, but I hope to get the job done from here.

Thanks!