Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

Need help with htaccess setup

posted by bhupi 8 years ago

Hi.

I am trying to setup a site with flourish (I am using xampp on Windows for development). The code is organized as follows:

/ -> root folder /inc -> flourish source code /data -> my code that connects to the DB and gets required data

By default, the site url looks like: http://localhost/flourish/data/?q=car

Now, using .htaccess in the root folder, I want this url to appear like: http://localhost/flourish/data/index.php?q=car

Can someone help and let me know what should be done? Whats the rewrite rule I should use? And where should the .htaccess be put, in the root or in the data folder?

bhupi,

I'm a bit confused, perhaps you could clarify a bit? Your default URL and your rewritten URL are technically the exact same thing, and are not patterns that I've seen people write .htaccess to accomplish.

Your default URL is automatically referencing index.php, whereas your desired URL implicitly states to use index.php. Both do the same thing unless you have a file named index.html, in which case your default URL will try to query index.html instead of index.php.

posted by titus 8 years ago

Hi Titus.

Thanks for responding. I guess my question was incorrect :)

I wanted to redirect: http://localhost/flourish/data/car To: http://localhost/flourish/data/?q=car

I have done this using .htaccess redirect rules.

I have another question though:

I need a regex that can redirect 1: "http://localhost/flourish/data/car" to "http://localhost/flourish/data/?q=carquot; 2: "http://localhost/flourish/data/car/audi" to "http://localhost/flourish/data/?q=car&m=audi"

Notice that the last "/" is missing in the source url.

Can you help me here?

posted by bhupi 8 years ago