hello am building a site and would need people to be able to access there webpages using a urkl such as www.example.com/username , i was able to implement a solution using the route (:any) feature ,but i encountered two problems :开发者_C百科:: 1.i have to implement the route to all the pages on the website. 2.user avatars where no longer showing because instead of pointing to the images directly by following the directory path i usually call the images with a function in the controller
so i was wondering if there was a way to go about this using a .htaccess file while eliminating index.php in the proccess ... thank you
You need to take a look at mod_rewrite (for your webserver; like Apache). This module can rewrite pretty url's to your website structure, thus presenting nice url's and have your site behave normal.
ShiVik posted a pretty thorough answer here. I'm about try it out.
精彩评论