Jump to content

I Need A Server That Letsme Rewrite Files


ApocalypeX
 Share

Recommended Posts

Every web server has its own settings and its own way of letting the user manipulate them. Apache's way is just the one there is most information for.Microsoft's IIS web server can also have configuration files, though it calls them "web.config", and they also look different than .htaccess files. IIS7's RewriteModule is Microsoft's equivalent to Apache's mod_rewrite.Unless a hosting plan's description explicitly states to have ".htaccess" or "web.config", there is no way to be sure without asking them and/or trying them out.

Link to comment
Share on other sites

Every web server has its own settings and its own way of letting the user manipulate them. Apache's way is just the one there is most information for.Microsoft's IIS web server can also have configuration files, though it calls them "web.config", and they also look different than .htaccess files. IIS7's RewriteModule is Microsoft's equivalent to Apache's mod_rewrite.Unless a hosting plan's description explicitly states to have ".htaccess" or "web.config", there is no way to be sure without asking them and/or trying them out.
Well what about a unix server? How would I rewrite a file on that?
Link to comment
Share on other sites

UNIX is an OS. And like I said, how you do URL rewriting depends on the web server, not the OS.But now that you've said it like that, I have to ask... are we really talking URL rewriting, or are we talking file rewriting (i.e. the contents of file X is replaced by the contents of file Y)? I'm assuming you mean URL rewrite, but if you mean file rewriting, you can use any server side scripting language for that, like PHP for example... on any OS and web server.

Link to comment
Share on other sites

If you are asking because you have tried using function like fwrite or file_put_contents, and the operation fails, it is probably a matter of setting the correct Unix file permissions. You can set permissions initially with your ftp program (most or all of them have this ability, I think). You can also look into the chmod function. If you plan on doing a lot of file writing in general, you should read a fair amount about file permissions. Experiment with trivial documents till you think you get it.

Link to comment
Share on other sites

I've created a PHP script that creates sigs with stats on it. When the page runs it replaces a img file with a new one. The script works. I have no problems on my IIS local host server. But on my webhost its being silly and wont rewrite. Infact when I create the .htaccess file it stops it from being read.

Link to comment
Share on other sites

OK, now I'm totally confused... what kind of rewrite are we talking again? Can you provide the PHP script? Or at least a link from the local IIS and/or your web host server?

Link to comment
Share on other sites

OK, now I'm totally confused... what kind of rewrite are we talking again? Can you provide the PHP script? Or at least a link from the local IIS and/or your web host server?
A file rewrite.http://apx.comlu.com/siggen.php
$finder3 = "blah";$finder3_2 = "blahblah";// get the original image$im = imagecreatefrompng("SIGS/groundpounder.png");// new color$blue = imagecolorallocate($im, 0, 0, 255);				 // blue$red = imagecolorallocate($im, 255, 0, 0);				  // redimagestring($im, 10, 405, 35, $finder3, $red);imagestring($im, 10, 535, 35, $finder3_2, $red);imagepng($im,"SIGS/ApocalypeX.png");imagedestroy($im);unset($assassin);print "<img src=SIGS/Bungle.png> <br>Modified image<BR> <img src=SIGS/ApocalypeX.png>";

Edited by ApocalypeX
Link to comment
Share on other sites

Appears to be working when I try it... but it does say

Unable to open 'SIGS/ApocalypeX.png' for writing: Permission denied in /home/a1559848/public_html/siggen.php on line 37

Which means you should make sure you can write in the SIGS folder. Try to do:

chmod('SIGS', 0777);

before you call imagepng(), and see if that yells any more errors.

Link to comment
Share on other sites

Same thing, do I need to edit it in anyway?This may help:When I look at my file manager the folder permissions says : rwxr-xr-x & the file "ApocalypeX.png"'s perms are: rw-r--r--

Edited by ApocalypeX
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...