Click here to Skip to main content
15,905,563 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to create a small htaccess for my personal website ([^]). Currently I have something similar to masterpage in PHP (index.php) and the top toolbar links redirect with a querystring.

Depending upon the querystring and after doing a bit of sanity checks and business rules validation, I am displaying an appropriate information for the link. But since every URL shows as index.php (index.php?pg and index.php?pg=2), the statistics is quite confusing and hence I am trying to see if I can get a URLRewriter in htAccess which would do the following

Anything after index.php would get rewritten as index.php?pg=<anything>

While I was able to get this, what happens is index.php/something/something renders the default content but the images are broken because the web server thinks the images should be served from /something/something/

Is there a way we can have a htAccess which would translate anything after index.php to index.php?pg=<anything> but stop this anything translation on encountering the first /?
Sergey Alexandrovich Kryukov 8-Apr-13 12:18pm    
This is ".htaccess", not "htAccess".

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900