User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Existing Scripts section within the Web Development category of DaniWeb, a massive community of 426,422 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,382 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Existing Scripts advertiser: Web Code Converter
Views: 848 | Replies: 0
Reply
Join Date: Nov 2007
Posts: 86
Reputation: sagedavis is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
sagedavis sagedavis is offline Offline
Junior Poster in Training

htaccess issue

  #1  
Feb 17th, 2008
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
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Existing Scripts Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Existing Scripts Forum

All times are GMT -4. The time now is 2:07 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC