Forum Moderators: phranque

Message Too Old, No Replies

Apache and Mod Rewrite

Problem resolving a directory structure through .htaccess

         

Dr Livingston

10:39 am on Apr 9, 2006 (gmt 0)



Hello,

I am trying to use clean urls like these below,

* [localhost...]
* [localhost...]
* [localhost...]

The problem is that the files do not reside on the DOCUMENT ROOT, so here is the directory structure I have,

htdocs
+--- public_html
+--- --- dev
+--- --- --- admin
+--- etc ---

The index.php file directory path is /htdocs/dev/admin/ so when I use for example

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)/?$ index.php [L]

I get using $_SERVER['REQUEST_URI'] the following

/dev/admin/blog/create/

Where I actually just want to have /blog/create/ so what changes do I need to make to the .htaccess file to?

So, what I want is just to remove the directory path it's self from $_SERVER['REQUEST_URI'] so I just have

* /blog/create/
* /blog/modify/123/
* /blog/search/date/2006/04/10/

Kind of lost at the moment and I can't decide exactly the problem so I can't find a solution :(

jdMorgan

1:26 pm on Apr 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dr Livingston (I presume),

Welcome to WebmasterWorld!

Try anchoring the substitution URL to root, i.e. /index.php
Also see the RewriteBase directive documentation, as you may need to use it in this case.

Jim