Warptweet Posted May 28, 2007 Share Posted May 28, 2007 Okay, I own www.uploadpoints.com, it is an uploading website. It is designed to be the absolute easiest file, image, and music host ever created. The very front page contains the upload form, and is just immediate service. Right after the file is upload, it gives you a link to the viewing page of the file, image, or music you uploaded. If you upload a file, and the file you uploaded is the 40th file uploaded, it would be www.uploadpoints.com/view.php?id=40. If you upload a file, and the file you uploaded is the 50th file uploaded, the ?id would =50 Now, the way that the viewing page is not the same as the index.php for my normal website means my viewers have to the in www.uploadpoints.com/view.php?id=??? and that can be a very painfully annoying process. Now, my question is, is it possible to simply let users type in www.uploadpoints.com/??? with the ???=the number they typed in, and it will automatically redirect to www.uploadpoints.com/view.php?id=???? Example: You type in www.uploadpoints.com/15 /15 isn't a file, nor an existing directory. It will simply redirect you to... www.uploadpoints.com/view.php?id=15 Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted May 28, 2007 Share Posted May 28, 2007 mod rewrite url do this open .htaccess in notepad put this in it RewriteEngine On RewriteRule ^(.*) view.php?id=$1 Quote Link to comment Share on other sites More sharing options...
dj-kenpo Posted May 28, 2007 Share Posted May 28, 2007 you can do this with .htaccess RewriteEngine on RewriteRule ^/(.*) /view.php?ID=$1 I beleive,..... or is it ^(.*) .... I dunno, try it out... Quote Link to comment Share on other sites More sharing options...
dj-kenpo Posted May 28, 2007 Share Posted May 28, 2007 oh, there you go. Quote Link to comment Share on other sites More sharing options...
Warptweet Posted May 28, 2007 Author Share Posted May 28, 2007 I tried all of your codes, but when I went to something like www.uploadpoints.com/15, it wouldn't take me to www.uploadpoints.com/view.php?id=15 Also, if I didn't enter a /??? it wouldn't take me to the main page. I only want this to happen if there is a number after www.uploadpoints.com, if it is www.uploadpoints.com alone, then I need it to stay that way. Have any ideas how to do this? Thanks for trying at least Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted May 28, 2007 Share Posted May 28, 2007 dude it works for me i just tested it on my site Quote Link to comment Share on other sites More sharing options...
Warptweet Posted May 28, 2007 Author Share Posted May 28, 2007 Try it yourself. www.uploadpoints.com Try something, the entire website is kind of messed up. Quote Link to comment Share on other sites More sharing options...
dj-kenpo Posted May 28, 2007 Share Posted May 28, 2007 then it's your .htaccess file and how you've written it or your server. the code is fine and not the issue. google tutorials on .htaccess and do some reading up on what it is and how it works. good luck Quote Link to comment Share on other sites More sharing options...
Warptweet Posted May 28, 2007 Author Share Posted May 28, 2007 When I write other codes on .htaccess such as redirecting codes, they seem to work. But his code in particular I'm not sure Oh well. Quote Link to comment Share on other sites More sharing options...
dj-kenpo Posted May 28, 2007 Share Posted May 28, 2007 like I said, google it then, there's lots of tutorials on the net on how to do this, and now that you know the method, you shouldn't need any help. just google away and trial and error till it works Quote Link to comment Share on other sites More sharing options...
Warptweet Posted May 28, 2007 Author Share Posted May 28, 2007 Nevermind, I found a code for .htaccess that works, and does exactly what I want. Thanks for you help guys, but your help was unneccessary. Quote Link to comment Share on other sites More sharing options...
dj-kenpo Posted May 28, 2007 Share Posted May 28, 2007 "your help was unneccessary" I'll keep that in mind next time you post a question. in the meantime please mark the thread as solved, and for the benefit of other users you could post the code you found that worked for you if ours didn't for some reason. Quote Link to comment Share on other sites More sharing options...
Warptweet Posted May 29, 2007 Author Share Posted May 29, 2007 I'm sorry if you took that in a bad way It wasn't meant as an offence, I usually use the help I receive. It really isn't my fault if your code didn't work, it's the .htaccess codes fault. The code I used was... RewriteEngine On RewriteRule ^([A-Za-z0-9-]+)/?$ view.php?id=$1 Again, thanks for trying, I was simply stating I found my own way. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.