Jump to content

mdedens

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by mdedens

  1. Hello, I was wondering what the path to php is? Does this look correct? /usr/local/lib/php Thanks
  2. I have this URL, but can't get it to 301 redirect without appending variables to the end of the static URL. Is there a way around this? >redirect 301 /Default.asp?page=32 http://***DomainName***/about-us/ This only applies to a few URLs, so I just need an example of this specific URL 301 redirected. I also tried this to no avail: >RewriteRule ^Default.asp?page=32 /about-us/? [R=301,NC,L] Any advice is appreciated.
  3. Finally found what I needed... thanks again for all your help. It pointed me in the right direction >Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC] RewriteCond %{REQUEST_URI} ^/olddir/ RewriteCond %{QUERY_STRING} CAT=100&catName=Widgets RewriteRule ^(.*)$ http://***.newdomain.***/widgets.php? [R=301,L]
  4. Hi Click I gave it a try but the old page still shows up normally. Both directory.php and any version with strings of characters after it show up fine. Also, I only put the code given here in the htaccess.
  5. Hi Andy, Thanks for taking a crack at it. I tried the code, but still can't get it to work. The pages show up as normal. If this is going to be too complicated or time consuming to troubleshoot, is there an alternate method that could be used to redirect any URLs using that directory.php file. So any page that calls "directory.php" and no matter what comes after it, would redirect to one page on a new domain? like this URL: http://***.oldomain.***/olddir/directory.php?CAT=100&catName=Widgets would go to this URL: http://***.newdomain.***/directory.php'>http://***.newdomain.***/directory.php this URL: http://***.oldomain.***/olddir/directory.php?CAT=5654&catName=MoreWidgets would go to this URL: http://***.newdomain.***/directory.php Thanks again for your help!
  6. Hi, I have a 301 redirect setup in an old domain's htaccess file, but my URLs with "?" "&" and "%20" don't seem to be redirecting. So I thought I would ask the experts and see if anyone knows how to redirect a dynamic URL with special characters on an old domain to a static URL on new domain. (*** added so no URLs are in post) So I would like this URL: http://***.oldomain.***/olddir/directory.php?CAT=100&catName=Widgets To go to this URL: http://***.newdomain.***/widgets.php > Example: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC] redirect 301 /olddir/directory.php?CAT=100&catName=Widgets http://***.newdomain.***/widgets.php Thanks for any advice!
  7. Got it working!! For anyone interested, here was the final redirect code: >RewriteRule ^products/Wall-Sconses_2_4.php /products/Wall-Sconces_2_4.php? [R=301,NC,L]
  8. New info... I tried adding this to the htaccess... added the L, >RewriteRule ^products/Wall-Sconses_2_4.php /products/Wall-Sconces_2_4.php? [L, R=301,NC] And when I go to any page in the gallery it throws a 500 Internal Server error. Is this info in any way helpfully diagnostic?
  9. I tried creating products/Wall-Sconses.php today, (thought maybe adding a header redirect would work), but the page itself doesn't even show up in the browser when I go to the URL. I removed all redirects, and the header redirect, added some text to the page, but when I go to the URL it's still just a blank white page, aka 404 error. Does this offer any insight into what could possibly be wrong? Maybe it is those other re-write rules in the htaccess... If anybody knows where I can go to get help with this, I can see about compensation for figuring this out.
  10. Yea, that extra "_1" was a typo... sorry about that one. Not sure what's up. I'm afraid the problem must be deeper than what it appears to be. I tried typing in the URL, but it's just a blank white page, aka 404 error without redirecting. http://www.****.com/products/Wall-Sconses_2_4.php
  11. I wonder if there is some type of server or php config problem. I arranged everything accordingly but just get a blank white page in Firefox. And the IE 404 error page when visiting in IE. So basically just a 404 error page. I don't mean to overwhelm with this, but I thought maybe it would be helpful to post some code that appears in the products/index.php page that generates every other page under the products dir. It may be that the long way has been taken to creating 404 error pages and may be preventing redirects. (This all appears before the HEAD tag) Maybe something is familiar or obvious? (the call to the config file is just for connecting to the db, it contains username, pw, etc.) I appreciate the time you spend on this, don't stress if it gets to be too much. ><? /*if (!ini_get("register_globals")){ foreach ($_REQUEST as $k=>$v){ if (!isset($GLOBALS[$k])){ ${$k}=$v; } } }*/ $productName = isset($_GET["productName"]) ? $_GET["productName"] : ""; $product = isset($_GET["product"]) ? $_GET["product"] : ""; $photo = isset($_GET["photo"]) ? $_GET["photo"] : ""; $c = isset($_GET["c"]) ? $_GET["c"] : ""; $sc = isset($_GET["sc"]) ? $_GET["sc"] : ""; $subCategoryName = isset($_GET["subCategoryName"]) ? $_GET["subCategoryName"] : ""; $cat = isset($_GET["cat"]) ? $_GET["cat"] : ""; $subcat = isset($_GET["subcat"]) ? $_GET["subcat"] : ""; $page = isset($_GET["page"]) ? $_GET["page"] : ""; $categoryname = isset($_GET["categoryname"]) ? $_GET["categoryname"] : ""; require("../config/config.php"); if(!($link = @mysql_connect ($hostType, $dbUser, $dbPassword))) echo "cannot connect to database" . mysql_error(); else { mysql_select_db ($dbName) or exit("cannot select" . mysql_error()); } if($cat && $subcat) { $catquery404 = mysql_query("SELECT * FROM category WHERE catID=$cat"); $cat404 = mysql_num_rows($catquery404); $subquery404 = mysql_query("SELECT * FROM subcat WHERE subID=$subcat"); $subcatTitle = mysql_fetch_array($subquery404); $subcatName404 = "products/"; $replaceChars404 = array(" ", "'", ":", "/", ",", "&", "---", "&", "--"); $subcatN404 = str_replace($replaceChars404, "-", $subcatTitle["subName"]); $subcatName404 .= str_replace($replaceChars404, "-", $subcatN404); //echo $subCategoryName."<br />"; //echo $subcatName404; if($subCategoryName != $subcatName404) { header("HTTP/1.1 404 Not Found"); exit; } $sub404 = mysql_num_rows($subquery404); if($cat404 == 0 || $sub404 == 0) { header("HTTP/1.1 404 Not Found"); exit; } } else if($product && $photo) { //echo $productName."<br>"; $productError = mysql_query("SELECT products.productID, products.catID, products.subID, information.pageDesc FROM products,information WHERE products.productID = $product AND information.productID = $product"); $productRow = mysql_num_rows($productError); $photoError = mysql_query("SELECT photoID FROM photo WHERE photoID = $photo"); $photoRow = mysql_num_rows($photoError); $productErrorRes = mysql_fetch_array($productError); $photoErrorRes = mysql_fetch_array($photoError); $productName404 = "products/"; $replaceChars404 = array(" ", "'", ":", "/", ",", "&", "---", "&", "--"); $productN404 = str_replace($replaceChars404, "-", $productErrorRes["pageDesc"]); $productName404 .= str_replace($replaceChars404, "-", $productN404); //$productName404 .= "_".$productErrorRes["productID"]; //."_".$photoErrorRes["photoID"]."_".$productErrorRes["catID"]."_".$productErrorRes["subID"]; //echo $productName404; if($productName != $productName404) { header("HTTP/1.1 404 Not Found"); exit; } if($productRow == 0 || $photoRow == 0) { header("HTTP/1.1 404 Not Found"); exit; } } else if($cat) { $catquery404 = mysql_query("SELECT * FROM category WHERE catID=$cat"); $catTitle = mysql_fetch_array($catquery404); $cat404 = mysql_num_rows($catquery404); $catName404 = "products/"; $replaceChars404 = array(" ", "'", ":", "/", ",", "&", "---", "&", "--"); $catN404 = str_replace($replaceChars404, "-", $catTitle["catName"]); $catName404 .= str_replace($replaceChars404, "-", $catN404); //echo $categoryname."<br />"; //echo $catName404; if($categoryname != $catName404) { header("HTTP/1.1 404 Not Found"); exit; } if($cat404 == 0) { header("HTTP/1.1 404 Not Found"); exit; } } ?> <? $navSelect = mysql_query("SELECT * FROM category ORDER BY catID"); ?> <? //META DESCRIPTION CONTENT if($product && $photo) { $metaQuery = mysql_query("SELECT pageDesc,metaDesc FROM information WHERE productID=$product"); $metaResult = mysql_fetch_array($metaQuery); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
  12. Hi click, I appreciate you trying this out, you are correct in what I'd like to have happen. Do I have to keep the 301 redirect code? I tried with and without, and in different orders, but still can't seem to get it to work. Maybe it is because the pages are built in the htaccess file? Although I guess that shouldn't matter. Here is what I have now, but still getting the string on the end. (I tried removing the 301 redirect part, but then the page is just a 404 error page.) >AddType application/x-httpd-php .php .html AddType application/x-httpd-php .php .shtml Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_Host} ^****.com [NC] RewriteRule ^(.*)$ [url="http://www.****.com/$1"]http://www.****.com/$1[/url] [L,R=301] RewriteRule (.*)_(.*)_(.*)_(.*)_(.*)\.php$ /products/index.php?productName=$1&product=$2&photo=$3&C=$4&sc=$5 [L] RewriteRule (.*)_(.*)_(.*)_(.*)\.php$ /products/index.php?subCategoryName=$1&cat=$2&subcat=$3&page=$4 [L] RewriteRule (.*)_(.*)_(.*)\.php$ /products/index.php?subCategoryName=$1&cat=$2&subcat=$3 [L] RewriteRule (.*)_(.*)\.php$ /products/index.php?categoryname=$1&cat=$2 [L] RewriteRule ^products/Wall-Sconses_2_4.php /products/Wall-Sconces_2_4.php? [R=301,NC] redirect 301 /products/Wall-Sconses_2_4.php [url="http://www.****.com/products/Wall-Sconces_2_4.php"]http://www.****.com/products/Wall-Sconces_2_4.php[/url]
  13. Hi, I appreciate anyone that could offer advice on this, or even a link to someplace I could not find yet with more info. I'm using a friends custom gallery script, which currently has an htaccess file that looks like this: > AddType application/x-httpd-php .php .html AddType application/x-httpd-php .php .shtml Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_Host} ^****.com [NC] RewriteRule ^(.*)$ [url="http://www.****.com/$1"]http://www.****.com/$1[/url] [L,R=301] RewriteRule (.*)_(.*)_(.*)_(.*)_(.*)\.php$ /products/index.php?productName=$1&product=$2&photo=$3&C=$4&sc=$5 RewriteRule (.*)_(.*)_(.*)_(.*)\.php$ /products/index.php?subCategoryName=$1&cat=$2&subcat=$3&page=$4 RewriteRule (.*)_(.*)_(.*)\.php$ /products/index.php?subCategoryName=$1&cat=$2&subcat=$3 RewriteRule (.*)_(.*)\.php$ /products/index.php?categoryname=$1&cat=$2 I added a 301 redirect from an old page to a new page, but it doesn't seem to be working correctly. Here is the code I added to the top of the htaccess file for the 301 redirect. (sconses was spelled wrong, and the pages are created on fly via the code above... based on whatever the title of the product is in the database, I think) >redirect 301 /products/Wall-Sconses_2_4.php [url="http://www.****.com/products/Wall-Sconces_2_4.php"]http://www.****.com/products/Wall-Sconces_2_4.php[/url] Now when I go to the old page, it redirects incorrectly to this: >http://www.****.com/products/Wall-Sconces_2_4_1.php?subCategoryName=products/Wall-Sconses&cat=2&subcat=4 The above URL actually works in terms of the page not being broken, but it adds that unwanted second part. >?subCategoryName=products/Wall-Sconses&cat=2&subcat=4 The problem is since both URLs technically work, I didn't want to get hit for a duplicated content page. (There are multiple redirects/pages like this.) So basically, anyone know how I can get the redirect to stop adding that extra URL code? Any help is much appreciated. Thanks for your time.
  14. Possibly... I have this line above it: (my old site had an index.shtml page, but the new one is .php) >redirect 301 /index.shtml http://www.****.com/index.php and this below it, for image protection and redirecting the non-www domain: >Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_Host} ^****.com [NC] RewriteRule ^(.*)$ http://www.****.com/$1 [L,R=301] RewriteCond %{HTTP_REFERER} !^http://****.com/ [NC] RewriteCond %{HTTP_REFERER} !^http://****.com [NC] RewriteCond %{HTTP_REFERER} !^http://www.****.com/ [NC] RewriteCond %{HTTP_REFERER} !^http://www.****.com [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC] Sorry I shoulda posted this in the first place. (not sure if that bottom part is the most efficient way to redirect and image protect, i keep seeing many different ways and don't know what's best)
  15. Hi, I setup a 301 redirect for a directory that contained numerous subdirectories, (all got indexed by Google accidentally.) Here is an example of the code: >redirect 301 /olddir http://www.****/index.php However if I go to a link like this: >http://www.****/olddir/album01/blahblah It ends up going here: >http://www.****/index.php/album01/blahblah I don't know the names of all the subdirectories, there are hundreds too. So I was wondering if there is a way to include all subdirectories in 1 line of code. Thanks for any suggestions. oye, sorry about the URLs, i forgot those are probably not allowed... trying to turn them off... ok got it.
  16. Yea, all resolved... well I have a lot work to do now, but I know what happened. Apparently the Hotlink Protection overwrites the .htaccess file. I had spent quite a bit of time editing all my .htaccess files for all my clients, based on their site's needs. This was quite an unfortunate mistake having turned on the hotlink protection. I wonder if it would be possible to add a note on that page in cpanel it will overwrite your file. Or fix the script to just append whatever it puts in there. Although, I still have yet to find out why adding the hotlink protection does not work on Gallery images.
  17. It seems as though "HotLink protection" has messed up my WordPress blog too. I get a 404 page when I click on any of my navigation.
  18. Hi, I recently turned on Hotlink Prevention because 95% of my bandwidth was going to leechers at myspace. What I was wondering is if there is a way to allow 1 or 2 images to allow linking on. They are used in my related myspace account, and I don't know how to use them, but block everyone else on myspace. I hope this makes sense. Also, I noticed all the images in my menalto Gallery's are not included in this "hotlink prevention". That is where the bulk of my images are, and I'm not sure what to do about it. Has anyone else encountered similar problems and found a solution?
  19. Does anybody know how to fix this? ever since the server crash last week, my site and my clients with Gallery have this error on their album pages of Gallery. (I installed Gallery a while ago, and don't have time to upgrade them all, so I need to get them working without upgrading) Warning: fopen(/home/myusername/public_html/photogallery/albums/album31/photos.dat.lock) [function.fopen]: failed to open stream: Permission denied in /home/myusername/public_html/photogallery/platform/fs_unix.php on line 55 Error: Could not open lock file (/home/myusername/public_html/photogallery/albums/album31/photos.dat.lock)!
  20. I'm not sure if it's because of the problems at TCH today, but my blogger.com blog can not publish to my website. I can FTP fine, the username/password for which is all blogger.com needs to publish, so I'm not sure what's going on. Any others have this problem?
  21. All this time and I had no idea...Removing the domain name worked... thank you David! =)
  22. Hi, I had uploaded a Google sitemap, and was recently trying to "verify" it with a new utility they provided on the Google website. I just had to upload an html file that Google can use to verify my sitemap. This worked fine on a different server/host, but I'm unable to verify on my TotalChoiceHosting domains. The error I get from Google is this: *************** We've detected that your 404 (file not found) error page returns a status of 200 (OK) in the header. this configuration presents a security risk for site verification and therefore, we can't verify your site. If your web server is configured to return a status of 200 in the header of 404 pages, and we enabled you to verify your site with this configuration, others would be able to take advantage of this and verify your site as well. This would allow others to see your site statistics. To ensure that no one can take advantage of this configuration to view statistics to sites they don't own, we only verify sites that return a status of 404 in the header of 404 pages. Please modify your web server configuration to return a status of 404 in the header of 404 pages. Once your web server is configured correctly, try to verify the site again. If your web server is configured this way and you receive this error, click Check Status again and we'll recheck your configuration. *************** I added this to my .htaccess file, but still no luck: ErrorDocument 404 *****/ Any ideas how to fix this or if it's possible? Thanks for your help.
  23. Hi, I had a question about PDA sites. Both in terms of scripting and practicality. Scripting. I've heard there are countless browsers, platforms, colors, etc to code for. And the way a PDA site is built is such that an elusive Header Script is put into the regular site, which somehow figures out if the surfer is on a PC vs PDA, and what their platform, browser, resultion is etc, and sends them the correct site. So my first question is, does anyone know how to program this Header Script? Practicality. Maybe this should be my first question. Does anybody know of any statistics, or can relate their own experiences, about whether or not people use PDA's to surf the web. Do people use Google on PDA to search for things? Thanks for helping out a curious site maker.
×
×
  • Create New...