Jump to content

powerspike

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by powerspike

  1. RewriteRule ^([0-9]+)/$ profile.php?user_id=$1 [L,NC] RewriteRUle ^([a-zA-Z0-9]+)/$ profile.php?user=$1 [L,NC] that should do it for you.
  2. RewriteRule ^users/([A-Za-z0-9]+)/$ users/index.php?user=$1 [L,NC] http://www.website.com/users/John/ i think that will do what you are asking it'll take the username out of the above url and put it in $1 for you.
  3. <form action="site.com/bannanas/3"> but i'm going to guess that isn't what you want.... If you want it to redirect based on what the user has submitted into the form, the submit form will need to submit the data, and the script that processes it will need to use a header("Location: http://site.com/bannanas/3/"); and do it - remember that mod rewrite can't process data.... it's not a scripting language.
  4. could you post an example of the url you are trying to request ? it'd help alot. RewriteBase /classifieds/ RewriteRule ^ad([^/]+)\.html$ classifieds/detail.php?id=$1 [L] requesting http://www.yoursite.com/classifieds/ad34.html would load classifieds/detail.php?id=34 if that doesn't work please post a couple of sample urls that aren't working, it'll help alot.
  5. you'll find people usally do it the other way around, redirect no trailing slash to a trailing slash, some web servers do that automaticly as well, so you might want to think about doing it's it that way not sure if this would work or not, but you can give it a go RewriteRule (.*)/$ $1 [L]
  6. not sure about that but one way you can do it RewriteRule ^faq/(.*)/$ http://someaff.site.com/x=faq&id=$1 [L] so you'd like to something like www.mysite.com/faq/343f2/ and the 343f2 would be your aff code. hopefully that'll work for you.
  7. ok hopefully it is as easy as it seems change the[L] to [L,QSA], and you might need to remove the ? off the end of the search urls (the string directly after the Rewrite rule). hopefully that'll fix it right up for you.
  8. a hackisk way to get it done, would be to get the amount rows in the table, like "select row_id from table where order by row_id DESC limit 0,1"; then do a "select * from table where row_id = " . rand(0,$row_id) . "' limit 0,1"; ($row_id would be the row_id from the first query). As i said, it's a hackish way, i'm quite sure there is a better way to do it thou. PS, this assumes you have a row_id and it's in some type of order.
  9. There will be an option in your ftp client along the lines of "hide dot files", you need to turn that off, otherwise try using a program like winscp (it doesn't hide them)
  10. [-_A-Za-z0-9\ \.] try that instead =) (instead of [-_A-Za-z0-9\ ].[-_A-Za-z0-9\ ])
  11. Firefox will usually tell if you if i can't find a server or connect to it, that error message to me would indicate there might be an issue with apache (or something blocking port 80 traffic). Your zone file looks good (no issues) but maybe you want to point your mx record to "mail" - just make it a little neater (warning: personal preference) One last thing, find out what ip address is the main address of apache, the www record is pointing to .88, it might be wrong (looking at you have 55,56,88,89) but apache might not be setup to use 88 & 89 so wouldn't be accepting connections on those ip addresses.
  12. If you are using windows, i would suggest you look at winscp, it's free, and uses scp as a transfer protocol, with ftp as fallback if needed. If you are uploading a lot of files, try putting then in one archive and unzip them on the server directly, this will save you alot of time as well.
  13. This to me seems like a couple of questions in one, but I'll try and answer the best I can. 1) if you are coding projects in sub directorys, that you'll need to either use the full path to the images folder, ie http://www.domain.com/project1/images/img.png. Or if you link to the image in your html like images/bob.png, it'll try and load "images/bob.png" using your current folder as the base. 2) You might want into looking into using virtual hosts and sub domains if you want it to act like a real website I.e bob.domain.com - project 1, joe.domain.com - project 2. I'm not sure if this helps you or not.
  14. i believe the way reload works, is that it checks if all the files are the same, where as if you goto the url again (re-visiting - not reloading) it doesn't check "static" files. I have seen this as well, personally i don't worry about it at all.
  15. Ok, when you setup php on apache, you need to add in both "AddType" and "AddHandler" you'll find that AddType is missing, once you add it, and restart apache, it should all work fine. AddType application/x-httpd-php .php .phtml
  16. Maybe check your settings in MSIE, there are different secutiry settings for local/intranet/internet, it could possibley be one of those settings that are effecting your testing / programming. AddType application/x-httpd-php .php .phtml
  17. Maybe it has something to do with mod negotiate or mod spelling (not sure if those are the current names) - check and see if they are enabled, and if they are - try disabling them and see if that fixes it.
  18. try setting it to /tmp (if linux) or if windows try creating a folder in c:\ called tmp, and make sure that the "everyone" user has full read/write access to it. Also put a file in your document root which contains the contents of <?=phpinfo()?>, and load it in your browser, and make sure that your php.ini file is showing (it should be in the first panel), if it's not showing, it's not loading a php.ini file.
  19. INSERT INTO downloads (title, category) VALUES ('$title', '$category', '$date') you are basicly trying to insert three bits of data into two fields. you'll need to change the (title,category) to (title,category,time) where "time" is the name of your time/date field.
  20. Maybe you should be using the RewriteCond instead of attempting to block it with a rule, i haven't used them much myself, so unsure on what the syntax would be on it.
  21. RewriteEngine On RewriteRule ^features/(.*)/$ htms/feature-page.php?id=$1 RewriteRule htms/google.html http://www.blah.com (please note, i always put a / on the end of sef url's - makes it look cleaner imo)
  22. try giving this a go, RewriteRule ^(.*)$ coming_soon.php [L,NC]
  23. you could put a index.php file in the file with the contents of <? header("Location: <url to redirect >"); ?> that should do what you want.
  24. if your doing match up's on tables, it might be creating a temporary table for the query (which would explain the time) index rank and id in both tables and see if that helps alot, also remove any unneed indexs on both tables, as that'll slow things down as well A.rank = B.rank (in the slow query) ... if they are both indexed you might find it gets alot quicker for you.
  25. Heya all, i have just created some new forums, www.php.im, i really enjoy my php coding, and wish to help others with it as well. Any suggestion or feedback on how i could make them better will be greatly welcomed.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.