I came up with a fix, although not elegant.
In the www root directory I had a master.php and a debug.php.
master.php provides the master template (header, menu, footer, etc.).
Ideally, master.php should call a function named get_content() located
in debug.php (or any other content supplying file) and display a
complete page.  It's a little more complicated than that, but you get
the idea.

For some reason, when I typed http://localhost/debug into the browser,
it automatically added the .php, displaying a blank page (there are
only functions defined in that file).

I renamed debug.php to _debug.php and just added the underscore before
including the file in master.php.  The rule I mentioned earlier now
works.

I'd much rather just tell apache to not append the .php automatically.
 The only plus to this is that a segregation of master pages and
sub-pages is enforced (underscores and no underscores).

On Sun, Apr 10, 2011 at 4:39 PM, Jackman <kd7...@gmail.com> wrote:
> I'm experimenting with mod_rewrite.  I'm following the following tutorial:
> http://articles.sitepoint.com/article/apache-mod_rewrite-examples
>
> Why does this work: RewriteRule ^/?$ master.php [NC,L]
>
> But not this: RewriteRule ^/?([a-zA-Z_]+)$ master.php [NC,L]
>
> Eventually, I'd like the latter (non-working) line to be something
> like: RewriteRule ^/?([a-zA-Z_]+)$ master.php?p=$1 [NC,L]
>
> I'd be happy to show off more code if you'd like to see it.  Thanks!
>
> --
> Andrew Jackman
> kd7...@gmail.com
>
> CONFIDENTIALITY NOTICE: This e-mail message, including any
> attachments, is for the sole use of the intended recipient(s) and may
> contain confidential and privileged information. Any unauthorized
> review, use, disclosure, or distribution is prohibited. If you are not
> the intended recipient, please contact the sender by reply e-mail and
> destroy all copies of the original message.
>



-- 
Andrew Jackman
kd7...@gmail.com

CONFIDENTIALITY NOTICE: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure, or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.
_______________________________________________
EUGLUG mailing list
euglug@euglug.org
http://www.euglug.org/mailman/listinfo/euglug

Reply via email to