fourice
asked on
htaccess solution for SEO friendly urls
Hi all,
seo friendly url's keeps giving me headaches. I want to use an htaccess file to use for example the following urls:
www.example.com
www.example.com/contact
www.example.com/blog
www.example.com/blog/article
www.example.com/blog/category
www.example.com/blog/category/1
www.example.com/blog/category/article
www.example.com/store/category
www.example.com/store/category/1
www.example.com/store/category/product
www.example.com/demo
www.example.com/demo/contact
www.example.com/demo/blog
www.example.com/demo/blog/article
www.example.com/demo/blog/category
www.example.com/demo/blog/category/1
www.example.com/demo/blog/category/article
www.example.com/demo/store
www.example.com/demo/store/category
www.example.com/demo/store/category/1
www.example.com/demo/store/category/product
Things like demo, store, blog etc. needs to be variable.
Who has a nice solution for this, my htaccess knowledge is poor and I cannot seem to find it.
seo friendly url's keeps giving me headaches. I want to use an htaccess file to use for example the following urls:
www.example.com
www.example.com/contact
www.example.com/blog
www.example.com/blog/article
www.example.com/blog/category
www.example.com/blog/category/1
www.example.com/blog/category/article
www.example.com/store/category
www.example.com/store/category/1
www.example.com/store/category/product
www.example.com/demo
www.example.com/demo/contact
www.example.com/demo/blog
www.example.com/demo/blog/article
www.example.com/demo/blog/category
www.example.com/demo/blog/category/1
www.example.com/demo/blog/category/article
www.example.com/demo/store
www.example.com/demo/store/category
www.example.com/demo/store/category/1
www.example.com/demo/store/category/product
Things like demo, store, blog etc. needs to be variable.
Who has a nice solution for this, my htaccess knowledge is poor and I cannot seem to find it.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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&subpag e=yyyy&sub subpage=xx xx
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]/pa ge
/[subsubsubpage]/[subsubpa ge]/[subpa ge]/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.
Your controlling php file is index.php
It accepts the following URL parameters page, subpage, subsubpage, subsubsubpage
e.g.
index.php?page=xxxx&subpag
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]/pa
/[subsubsubpage]/[subsubpa
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.
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!
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!
www.example.com/demo
www.example.com/blog
www.example.com/store
Maybe I didn't understand the problem correctly?