Re: Undefined index error

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

 



On Mon, Jan 19, 2009 at 15:39, Jason Pruim <japruim@xxxxxxxxxx> wrote:
>
> Only when you log into certain accounts and view the file after I had made
> changes :P

    I figured you had already changed it, but when you're root, you
don't have to log in to other accounts.  ;-P

> What I'm really going for is given this URL:
>
> purl.mysupersite.com/test/mail
>
> "test" refers to a record in the database.
> "mail" refers to a file on the server which is included when "mail" is
> present. Otherwise the main page is used.

    So then you'll use mod_rewrite, since Apache needs to tell PHP how
to parse it.  Otherwise, Apache is going to be looking for /test/mail.

#.htaccess:
#----
Options -MultiViews

RewriteEngine On

#
## Redirect to remove trailing slashes on extensionless URL requests
# If requested URL ending with slash does not resolve to an existing
directory....
RewriteCond %{REQUEST_FILENAME} !-d

# .... externally redirect to remove trailing slash.
RewriteRule ^(.+)/$ /index.php?s=$1 [QSA,L]


#
## Externally redirect clients directly requesting .php page URIs to
extensionless URIs
# If client request header contains php file extension....
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /[^.]+\.php\ HTTP

# ....externally redirect to extensionless URI.
RewriteRule ^([^.]+)\.php$ /index.php?s=$1 [QSA,R=301,L]


#
## Internally rewrite extensionless file requests to .php files ##
# If the requested URI does not contain a period in the final path-part....
RewriteCond %{REQUEST_URI} !(\.[^./]+)$

# .... and if it does not exist as a directory....
RewriteCond %{REQUEST_FILENAME} !-d

# .... and if it does not exist as a file....
RewriteCond %{REQUEST_FILENAME} !-f

# .... then add .php to get the actual filename.
RewriteRule (.+) /index.php?s=$1 [QSA,L]

# End .htaccess


    You can figure out the rest yourself.  ;-P

-- 
</Daniel P. Brown>
daniel.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

-- 
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