i have a hosting company that does not allow .htaccess (mod-rewrite is disabled) on linux, php, mysql and apache.
i want urls to be more seo/canonicals for my site. i have now:
/index.php
/flowers.php?id=41
/flowers.php?type=deco&mode=texture&color=red
etc...
is there a way to write something like:
/home
/flowers/12
/flowers/deco/texture/red
without using .htaccess and mod-rewrite? or i need to look for another hosting?
If you don't use a custom method (like the wikipedia for example) you can't. Like @BookOfZeus said, you need to enable mod-rewrite to do so. I would recommend it!
now, here's what you can do:
you have to setup your script to read the URL and then make parse it.
you can have:
/index.php/page1/page2.html
so the script will read the $_SERVER['PATH_INFO'] then split in the '/'. so you will an array, then you can do your logic to separate the content.
if you can, you can try to hide the PHP by adding this:
<Files index>
ForceType application/x-httpd-php
</Files>
so you will endup with a url like: /index/page1/page2.html
source:
http://webarto.com/50/php-seo-url-function
http://www.daniweb.com/web-development/php/threads/95933
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With