Ensuring all links go to index.php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

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?

I hope this question is clear enough, and thank you for any and all advice.

--
Dave M G
Ubuntu 6.06 LTS
Kernel 2.6.17.7
Pentium D Dual Core Processor
PHP 5, MySQL 5, Apache 2

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux