> PHP List,
> 
> This problem is a little hard to describe. Please forgive me in advance 
> if it's not clear.
> 
> I have set up my .htaccess file to work with my PHP script to create 
> "friendly URLs".
> 
> For example, the URL mysite.com/user/login will take the user to a page 
> where a user logs in.
> 
> It does this by stripping everything out except "user" and "login". It 
> takes "user" and creates a "user" object, and then passes a "login" 
> method to that class to take the user to the login page.
> 
> Somehow, in this process, the local URL is becoming "mysite/user", even 
> though I'm just using that "user" designation to drive the creation of 
> objects from classes.
> 
> So, for example, I have a link to logout which is simply 
> href="user/logout".
> 
> But when I mouse over it, and look at the status bar at the bottom of my 
> FireFox browser window, it says that the link points to:
> mysite.com/user/user/logout
> 
> That URL, obviously, doesn't work for my system. It tries to make a 
> "User" object and call a "user" method which doesn't exist.
> 
> So... my question is, why is the /user portion of my URL being retained 
> as a directory?

If the URL is as you describe, this should be href="/user/logout". Without the 
preceeding slash, this will only work from pages with a URL in the root of your 
site.

> 
> I thought it had something to do with setting headers. I want everything 
> to operate through the index.php file in my root directory, so I thought 
> I could do that by putting this at the top of the index.php page:
> 
> header("Location: /");
> 
> Or:
> 
> header("/local/server/www/directory/");
> 
> Bottom line is, how do I ensure that all links and user requests through 
> the URL end up going to the index.php in my web site's root directory?
> 

If your using headers to set the location, you need to provide a full URL, inc. 
protocol and domain. i.e. http://www.example.com/page.php

Edward 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to