Sponsored Content
Top Forums UNIX for Dummies Questions & Answers 302 server status code to 301/404 server status code Post 302524185 by hoo on Sunday 22nd of May 2011 06:14:50 AM
Old 05-22-2011
302 server status code to 301/404 server status code

Hello,

Sorry for my english.
I have an arcade site.
mydomain.com/game.html If database has the game name is good.
mydomain.com/fd43f54.html if database has not the game name redirect to mydomain.com by 302 error code.
if database has not the game name i want a 301/404 error code and no redirect.
I attached file.php to this post. Thank you very much for help.

my htaccess file:

RewriteEngine on
RewriteRule ^([_A-Za-z0-9-]+).html file.php?f=$1 [L]
RewriteRule ^([_A-Za-z0-9-]+)/$ browse.php?c=$1 [L]
RewriteRule ^([_A-Za-z0-9-]+)/([0-9]+) browse.php?c=$1&page=$2 [L]
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Apache /server-status

HI, Where is the script for /server-status handler located? Can i change code of the script somehow? Thank you all (3 Replies)
Discussion started by: solvman
3 Replies

2. Shell Programming and Scripting

How to check the file status in a remote server?

Hi All, Thanks in Advance. My requirement is there are some data files to be updated(some times new files get created) regularly in server A, these files are to be updated to the server B(backup server) by using SCP, I have to write a script for this purpose, before copying the files to server... (3 Replies)
Discussion started by: rajus19
3 Replies

3. Programming

How to check TCP server status

Please tell me according to C/C++ socket programming; how client can check whether server is running or not during TCP communication. (1 Reply)
Discussion started by: mansoorulhaq
1 Replies

4. UNIX for Dummies Questions & Answers

How to monitor Unix server CPU status?

I like to know how to monitor the UNIX CPU/memory status over time. I need to data to do some graphical representation of the server load. I sort of need to keep track of the vmstat but i dont know how. I hope someone would kindly help me out. thanks. (1 Reply)
Discussion started by: shingpui
1 Replies

5. Shell Programming and Scripting

To verify status of particular Component(Siebel Server srvrmgr)

Hi , I want to connect srver to pertuculat mode(i.e.srvrmanger)and after that I want to verify status of perticular component(i.e.CommOutboundMgr) For that I have created following script bout after 3rd line it is not executing 4th linei.e. list comp CommOutboundMgr. cd... (2 Replies)
Discussion started by: vivek1489
2 Replies

6. Shell Programming and Scripting

Find the remote server status.

Hi All, I would like to connect from "Instance A" to "Instance B" with the help of sftp. Where as Instance B is having clustered servers ( 2 servers pointing same instance ). Now, my question is before connecting to "Instance B" from "Instance A" how do know whether server is running or not.... (3 Replies)
Discussion started by: Girish19
3 Replies

7. UNIX for Advanced & Expert Users

CMD to check status of the server using Wget

Hi All, Using Wget I'm able to get the status of the server.....only when the server is completely down or up.... but problem here in script is Suppose if the server got hang I mean to say that if the server is taking long time to login, for example normally the server takes 3 seconds to login... (3 Replies)
Discussion started by: manohar2013
3 Replies

8. What is on Your Mind?

Server Status Updates on Twitter @UNIXLinux

Hey! In case members cannot login to the forums due to our data center going off line, please check our twitter feed for updates @unixlinux Looks like the Houston Level3 data center went offline briefly today (for about 15 minutes). HOLD ON HOUSTON! If you notice any issues and... (0 Replies)
Discussion started by: Neo
0 Replies
MONGOGRIDFS(3)								 1							    MONGOGRIDFS(3)

The MongoGridFS class

INTRODUCTION
Utilities for storing and retrieving files from the database. GridFS is a storage specification all supported drivers implement. Basically, it defines two collections: files, for file metadata, and chunks, for file content. If the file is large, it will automatically be split into smaller chunks and each chunk will be saved as a docu- ment in the chunks collection. Each document in the files collection contains the filename, upload date, and md5 hash. It also contains a unique _id field, which can be used to query the chunks collection for the file's content. Each document in the chunks collection contains a chunk of binary data, a files_id field that matches its file's _id, and the position of this chunk in the overall file. For example, the files document is something like: <?php array("_id" => 123456789, "filename" => "foo.txt", "chunkSize" => 3, "length" => 12); ?> <?php array("files_id" => 123456789, "n" => 0, "data" => new MongoBinData("abc")); array("files_id" => 123456789, "n" => 1, "data" => new MongoBinData("def")); array("files_id" => 123456789, "n" => 2, "data" => new MongoBinData("ghi")); array("files_id" => 123456789, "n" => 3, "data" => new MongoBinData("jkl")); ?> INTER-LANGUAGE COMPATIBILITY You should be able to use any files created by MongoGridFS with any other drivers, and vice versa. However, some drivers expect that all metadata associated with a file be in a "metadata" field. If you're going to be using other languages, it's a good idea to wrap info you might want them to see in a "metadata" field. For example, instead of: <?php $grid->storeFile("somefile.txt", array("date" => new MongoDate())); ?> use something like: <?php $grid->storeFile("somefile.txt", array("metadata" => array("date" => new MongoDate()))); ?> THE MongoGridFS"; FAMILY" MongoGridFS represents the files and chunks collections. MongoGridFS extends MongoCollection, and an instance of MongoGridFS has access to all of MongoCollection methods, which act on the files collection: <?php $grid = $db->getGridFS(); $grid->update(array("filename" => "foo"), $newObj); // update on the files collection ?> Another example of manipulating metadata: <?php // save a file $id = $grid->storeFile("game.tgz"); $game = $grid->findOne(); // add a downloads counter $game->file['downloads'] = 0; $grid->save($game->file); // increment the counter $grid->update(array("_id" => $id), array('$inc' => array("downloads" => 1))); ?> You can also access the chunks collection from an instance of MongoGridFS: <?php $chunks = $grid->chunks; // $chunks is a normal MongoCollection $chunks->insert(array("x" => 4)); ?> There are some methods for MongoGridFS with the same name as MongoCollection methods, that behave slightly differently. For example, Mon- goGridFS.remove(3) will remove any objects that match the criteria from the files collection and their content from the chunks collection. To store something new in GridFS, there are a couple options. If you have a filename, you can say: <?php $grid->storeFile($filename, array("whatever" => "metadata", "you" => "want")); ?> If you have a string of bytes that isn't a file, you can also store that using MongoGridFS.storeBytes(3): <?php $grid->storeBytes($bytes, array("whatever" => "metadata", "you" => "want")); ?> Querying a MongoGridFS collection returns a MongoGridFSCursor, which behaves like a normal MongoCursor except that it returns MongoGridFS- Files instead of associative arrays. MongoGridFSFiles can be written back to disc using MongoGridFSFile.write(3) or retrieved in memory using MongoGridFSFile.getBytes(3). There is currently no method that automatically streams chunks, but it would be fairly easy to write by querying the $grid->chunks collection. MongoGridFSFile objects contain a field file which contains any file metadata. CLASS SYNOPSIS
MongoGridFS extends MongoCollection Fields o public MongoCollection$chunks NULL o protected string$filesName NULL o protected string$chunksName NULL Methods o public MongoGridFS::__construct (MongoDB $db, [string $prefix = "fs"], [mixed $chunks = "fs"]) o public bool MongoGridFS::delete (mixed $id) o public array MongoGridFS::drop (void ) o public MongoGridFSCursor MongoGridFS::find ([array $query = array()], [array $fields = array()]) o public MongoGridFSFile MongoGridFS::findOne ([mixed $query = array()], [mixed $fields = array()]) o public MongoGridFSFile MongoGridFS::get (mixed $id) o public mixed MongoGridFS::put (string $filename, [array $metadata = array()]) o public bool MongoGridFS::remove ([array $criteria = array()], [array $options = array()]) o public mixed MongoGridFS::storeBytes (string $bytes, [array $metadata = array()], [array $options = array()]) o public mixed MongoGridFS::storeFile (string $filename, [array $metadata = array()], [array $options = array()]) o public mixed MongoGridFS::storeUpload (string $name, [array $metadata]) SEE ALSO
oMongoDB core docs on GridFS oLightCube Solutions blog post on saving user uploads oLightCube Solutions blog post on adding metadata to files PHP Documentation Group MONGOGRIDFS(3)
All times are GMT -4. The time now is 05:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy