# .htaccess forcetype masking of url variables

**URL:** <https://forum.kirupa.com/t/htaccess-forcetype-masking-of-url-variables/198539>\
**Category:** programming\
**Created:** [August 25, 2006, 9:36pm UTC](https://forum.kirupa.com/t/htaccess-forcetype-masking-of-url-variables/198539 "2006-08-25T21:36:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigjr](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@craigjr](https://forum.kirupa.com/u/craigjr)\
**Post date:** [August 25, 2006, 9:36pm UTC](https://forum.kirupa.com/t/htaccess-forcetype-masking-of-url-variables/198539/1 "2006-08-25T21:36:08Z")

</div>

Hi,

I’m trying to use htaccess forcetyping files as php which appears to be working. For example typing [http://www.example.com/pages/location](http://www.example.com/pages/location) will render the location file as a php page, additionally if [http://www.example.com/pages/location/test](http://www.example.com/pages/location/test) is typed then ‘test’ can be processed by some simple code accessing path variables as a variable to be used.

However the issue arises with my externally linked images/css etc that utilise relative paths e.g. an image in the full route path [http://www.example.com/images/test.jpg](http://www.example.com/images/test.jpg) is linked to using \<img src="…/images/text.jpg" /\> from a page in ‘pages’ however if using the ‘/’ delimiter url masking technique with ‘test’ on the end (as above) the relative url appears to turn to location/images as opposed to staying on /images.

Is there a way round this where I can maintain the ‘pretty urls’ and use relative paths from the file i.e. excluding seeing the path variables as directories

Cheers in advance
