Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by real_illusions

  1. The domain A records were changed, but were changed back again. I've looked into those search results (or similar) but not found anything solid that relates to this situation. I'm not aware of any rewrite rules on the server, its a windows server. I dont have access to it though, but I do have a contact for someone who does have access to it.
  2. I have a strange problem (not personally, but a website has a problem...)....anyway. Quick history lesson.1. Build a new website for a client.2. Initially was going to change hosting, and had the A records changed on their DNS records.3. Didn't go to plan due to security issues surrounding the A records and adding a domain to a new server solely on A records. DNS was reverted after 2-3 days downtime.4. New site uploaded onto old/current server. New home page is index.php, which didn't exist on previous site (as it was using index.htm or something else). Now, here where it gets a bit complicated. The site works fine for me, in all browsers, including the browser (Chrome in my case) I used to try the site when the DNS change was taking place.Client were also doing the same, but im not sure what browser they were using. Client says, that a week after the new site went live on their current server, in IE9, they are getting a 404 error. But not just any 404, its a Wordpress 404, in the new design. (previous site didnt use WP).Site works for them in all other browsers and other computers, such as Firefox and IE8. I thought this was simply a caching issue with the browser. They have cleared cache and history in ie9, but with no success. The rest of the pages work, and index.php works fine when accessed, it just the root url example.com/ that gets the 404. Is there anything that can be done so they can view the site?
  3. Ah, that was it, the - missing in the expression. Always something so simple you overlook and then someone else points it out and you feel like an idiot. Thanks
  4. Hi all, I have a rule setup thats similiar to another that works, but this one doesn't, and I cant work out why. Rule is as follows: RewriteRule ^latestnews-([a-zA-Z]+)/?$ newsitem.php?item=$1 [NC,L] Where the ending variable is used to get a database item, and thus displays the right content on the page, and is also displayed in the friendly URL. For example: /newsitem.php?item=newsitem-goes-here would appear as: /latestnews-newsitem-goes-here But instead, I get a 404 error. Now, I have a similiar setup on another page but that uses PHP switch statements to determine the content as the amount of content is quite small compared to this one that uses a database. The un-friendly URL with the variable in works fine, displays the content all ok, its just when accessing the friendly URL that it all goes a bit wonky and spits out a 404. Any ideas?
  5. Woo, finally, it works! It was the slash that was the problem. Thanks
  6. Have put in example.co.uk instead of the actual URL, and replaced a couple of page file names, and xx'd out the IP address that was causing problems. <Files .htaccess>order allow,denydeny from all</Files> ErrorDocument 400 /error400.phpErrorDocument 401 /error401.phpErrorDocument 403 /error403.phpErrorDocument 404 /error404.phpErrorDocument 500 /error500.php DirectoryIndex index.php RewriteEngine onRewriteCond %{HTTP_REFERER} !^$RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.co.uk/.*$ [NC]RewriteRule \.(gif|jpg)$ http://www.example.co.uk/dontsteal.gif [R] redirect 301 /oldpageone.php http://www.example.co.uk/newpageone.phpredirect 301 /oldpagetwo.php http://www.example.co.uk/newpagetwo.phpredirect 301 /oldpagethree http://www.example.com/newpagethree.php order allow,denydeny from xx.xx.xx.xxallow from allRewriteCond %{HTTP_HOST} ^example\.co.ukRewriteRule (.*) http://www.example.co.uk/$1 [R=301] RewriteRule ^/([a-zA-Z]+)/?$ location.php?area=$1 [NC,L]
  7. Other rules are working on the server (like non-www to www). Have taken off any [L]'s on other rules as that indicates its the last rule I believe, and still no joy.
  8. Oh yes, forgot about that. But still nothing when adding in the a-z part. Have tried removing the '+' bit but again, 404 error. Same with removing the /?, or even just ? or /, all 404 errors.
  9. I have this: RewriteRule ^/([A-Z]+)/?$ location.php?area=$1 [NC,L] Which doesn't create a 500 server error, but I still 404's when trying to access /areagoeshere for example. The underlying url is location.php?area=areagoeshere Why is it doing this?
  10. Cant make it do what I want it to. Found a few online generators but none seem to either do the trick I want or the code they product doesn't work. It doesn't produce a 500 error, it just produces a 404 error on the friendly url. Stuff like:RewriteRule /(.*) /page.php?page=$1 [PT] Even hard coding it this way doesnt work: RewriteRule ^/Something$ page.php?variable=Something And yes Rewrite Engine is on.
  11. Hi, If I have a page URL like this: example.com/page.php?variable=somethingexample.com/page.php?variable=something-goes-here Then how do I get it to show example.com/somethingorexample.com/something-goes-here via .htaccess? And would it still work? As in, would the browser pickup the variable and display the right content? Or is there a better way of doing this? Thanks.
  12. Hi,I've found the if_home and if_front_page to be potentially useful..but..also found that it causes problems.Current setup is that in the index.php file I have some static content followed by the list of blog posts, limited to only 1.When clicking on "older posts", it goes to /page/2/ as the URL, but its basically a repost of the home page.I then did this:<?phpif ( is_front_page() ) {query_posts('showposts=1');} else {query_posts('showposts=10');}?>And also surrounded the static content in a similiar way<?phpif ( is_front_page() ) {// static content} else {// nothing at all}?>I also tried it with is_home function, but neither work. I just get a repeat of the home page on a different URL and the most recent post rather than a list of the 10 recent posts. Anyone know why and how to get it to work?Thanks.
  13. It was all valid HTML when I did the input inside a label...although if the name attribute is required, but still valid HTML? Hmm..will have to see about that. Are the W3 saying that the input is valid without a name attribute, but yet its required for processing the form...interesting...
  14. Hmm..why is it a bad idea?Anyway...I would need the 2 lowest removed (so to speak) and the rest totalled up.Will see how those 2 queries work...
  15. Ah crap..how stupid do i look Thanks
  16. Hi all,I have a form which doesn't like sending the values of the input fields.I cant really show you the page with the HTML code as its a private project I'm working on.However, the PHP script I've used several times before, and although I've modified it to suit the form values this time around...nothing else has changed.Here is an example of one input value:<label for="firstname">First Name:<input type="text" id="firstname" value="" /></label>The form is <form method="post" action="test.php">and in test.php is simply var_dump( $_POST ); to find out whats been sent.Basically, the submit input value is the only one being sent. Even if I set an input with a value hard coded (such as the example above), it still doesn't send.Are there any possible reasons for this?
  17. Hi all,Is there an easy to way to add up all the numbers from a database but to discard the lowest?Each number is in its seperate field along with a name, for instance:Name 3 5 9 2 6 7Where I need to add them all up but discard the '2' as its the lowest number.Thanks
  18. Thats it. That was causing it.Seems to work ok now. Thanks
  19. It must be something to do with $_POST['discountcode'] in the codecheck.php, but as that file is called up via JS, how do I check what that variable is? Echoing it out breaks the script.If its not getting the value correctly..then how do I go about doing that?
  20. Hi,I'm trying to make a code checker, based from a username checker (hence the username variables and such)..but it wont seem to work. Whatever I put into the input field, I get "xxxx is not Available", even when it is.So,I have this, all these are on a webpage built into a form, and header includes and everything, but these are the relevant parts. I cant work out why its not reading whats in the array. Eventually, I will have the array populated from a MySQL database, and I swear this was working last night..but now it isn't....and have no idea why. Any clues?HTML (within a bigger form): <input class="req" type="text" name="discountcode" id="discountcode" /><a href="#" id="discountcodecheck">Check code</a><div id='discountcode_availability_result'></div> Javascript (jQuery library already included on the page): <script language="javascript">$(document).ready(function() { //the min chars for username var min_chars = 3; //result texts var characters_error = 'Minimum amount of chars is 3'; var checking_html = 'Checking...'; //when button is clicked $('#discountcodecheck').click(function(){ //run the character number check if($('#discountcode').val().length < min_chars){ //if it's bellow the minimum show characters_error text ' $('#discountcode_availability_result').html(characters_error); }else{ //else show the cheking_text and run the function to check $('#discountcode_availability_result').html(checking_html); check_availability(); } }); });//function to check username availabilityfunction check_availability(){ //get the username var username = $('#discountcode').val(); //use ajax to run the check $.post("codecheck.php", { username: username }, function(result){ //if the result is 1 if(result == 1){ //show that the username is available $('#discountcode_availability_result').html(username + ' is Available'); }else{ //show that the username is NOT available $('#discountcode_availability_result').html(username + ' is not Available'); } });}</script> PHP (codecheck.php): <?php//this varible contains the array of existing codes$existing_users=array('code1','code2','code3'); //value got from the get metho$user_name=$_POST['discountcode'];//checking weather user exists or not in $existing_users arrayif (in_array($user_name, $existing_users)){ //code is in the list echo 1;} else{ //code is not in the list echo 2;}?>
  21. Thanks, have figured out a solution.Its not too elegant as it does call the database a few times via the select statement to different tables, but it does the trick and seems to be the easiest to display whats needed.
  22. Hi,Would like some advice on the best way to achieve this.I have a bunch of data in the database, a number associated with a set name (out of a few choices).Now, for each name, I need to display the top 2 numbers (the 2 highest numbers).I could do a select statement for each name, but then that'll involve several calls to the database, which while it isn't the greatest sin in the world, its not exactly the greatest way of coding.I've been thinking of getting all the data, and making an array, and then for each name, sort the array by the 2 highest number.Does that make any sense?
  23. Thanks for your help.Have got it sorted and intergrated into sending an email with the relevant information now, in the right places.
  24. I'm just as confused now as I was to begin with...
  • Create New...