This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Transfer Learning for Natural Language Processing (MEAP) and have Paul Azunre on-line!
See this thread for details.
Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven

Use htaccess to implement pretty URL

Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I use pretty permalink in Wordpress. Apache's htaccess takes a GET URL like http://domain/path/value1/value2/value3/value4/ and serves it to PHP as something like http://domain/path/index.php?par1=value1&par2=value2&par3=value3&par4=value4

With Wordpress it works fine, but I need to implement it on a raw PHP software, without Wordpress tricks. I googled for a PHP solution and couldn't find one, not even an htacces example that would work without a CMS or framework.

If at least I could receive "/value1/value2/value3/value4/" in PHP I could split it, but not even that I'm able to do. Of course, be able to directly get each variable from $_GET would be better.

The maximum I was able to do was 301 redirect to http://domain/path/index.php?par1=value1&par2=value2&par3=value3&par4=value4 but that's not what I wanna do. I want browser to keep showing http://domain/path/value1/value2/value3/value4/ on address bar.

Could somebody give me hints, on a tutorial or at least a htaccess example?

Note I must be able to set 'domain' and 'path' separately, because the software may be installed on a domain root or inside a folder. And it must always go to index.php.
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic