sagedavis 0 Junior Poster in Training

I had no clue where to put this question. I know, I ask quite a few questions, but sometimes things get to bugging me and I need someone else to look at what mistakes I might have made and how.

Here's the deal.
In my website's root (public_html) I am using a lot of dynamic stuff. To fix the issue with proper indexing, I have chopped out some htaccess stuff to make my pages seem static.

RewriteEngine on
RewriteRule ^/admin/$ /admin/index.php [nc]
RewriteRule ^admin/$ /admin/index.php [nc]
RewriteRule ^([a-z0-9]+)$ /$1/ [nc]
RewriteRule ^([a-z0-9]+)/?$ index.php?name=$1 [nc]
RewriteCond %{HTTP_HOST} ^mysite.org$ [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.org$
RewriteRule ^/?$ http://www.mysite.org/home

I am not sure which of these rules are important or whatever. I mean, I understand what they do, and how they do what they do, but, something is messing me up. These might be in the wrong order, I don't know if it reads that way.

Here's what I am trying to do, perhaps one of you will know what is up?

In mysite.org I have index.php?name=home as the home page. I am obviously giving every page it's own name here where that field in the database is unique.

At first, I didn't have the last rewrite rule, so when I went to the main site, I got a page not found, adding the last rule fixed that issue. Everything is working fine in the root directory.

My problem is that these rules keep hurting my admin stuff.
I want to use relative urls within admin, so, if on index.php I referance add_page.php for instance, it should just take me there.
Oddly, at first it wouldn't let me, so I linked to it like /admin/add_page.php
Well, that worked for a while, but then, at some point, the url started reading /admin/admin/add_page.php

When I refresh the index page, it goes back to the way it was.
What do I need to change in my htaccess file to make this work right?
Thanks
Sage

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.