1

I have a single page that display stuff depending on a parameter :

domain.com/index.php/?id=foo

works as well as

domain.com/?id=foo

I would like to rewrite the parameter so that

domain.com/foo

also works.

BUT I have no access to the htaccess. I can use PHP and JS/jQuery.

I'm pretty sure this is not possible but I would like a confirmation.

edit : I would like to avoid the multi-pages trick, as the parameter is just a simple js variable and nothing else. These variables will change on a regular basis so I don't want any hardcoded information.

kursus
  • 1,396
  • 3
  • 19
  • 35
  • Is `domain.com/#foo` acceptable? You can then use Javascript to parse the hashtag, and if you need a bit more of a robust URL routing solution you can try something like `Sammy.js` http://sammyjs.org/ – cjd82187 Nov 03 '13 at 18:02
  • 2
    Your requirements are not fulfillable with the given constraints. – mario Nov 03 '13 at 18:04
  • Thanks you should make it an Answer. – kursus Nov 03 '13 at 18:07

1 Answers1

0

Well then you have to change the way of setting your files. I meean ..

IF i have this url: domain.com/?id=foo -> It means THAT I have 1 general INDEX, and I am including that FOO page .. (more simple: your index is openning a dir, that is called FOO and gets the content ot it) To make it like this : domain.com/foo , you have to change your way file structure. You still have to make a different folder for each page, but they HAVE TO be in the root dir.

Example for domain.com/foo:

  root dir /
    -> index/ 
        => index.php
    -> foo/ 
        => index.php

Got it ?