Search Results

Search found 3190 results on 128 pages for 'isapi rewrite'.

Page 49/128 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • How do I rewrite .after( content, content )?

    - by Evan Carroll
    I've got this form working, but according to my previous question it might not be supported: it isn't in the docs either way -- but the intention is pretty obvious in the code. $(".section.warranty .warranty_checks :last").after( $('<div class="little check" />').click( function () { alert('hi') } ) , $('<span>OEM</span>') /*Notice this (a second) argument */ ); What this does is insert <div class="little check"> with a simple .click() callback, followed by a sibling of <span>OEM</span>. How else can I write this then? I'm having difficulty conjuring something working by chaining any combination of .after(), and .insertAfter()? I would expect this to work, but it doesn't: $(".section.warranty .warranty_checks :last").after( $('<div class="little check" />').click( function () { alert('hi') } ).after ( $('<span>OEM</span>') ) ); I would also expect this to work, but it doesn't: $(".section.warranty .warranty_checks :last").after( $('<span>OEM</span>').insertAfter( $('<div class="little check" />').click( function () { alert('hi') } ) ); );

    Read the article

  • Rewrite this function as DB query?

    - by aLk
    I'm cleaning up my code, should i change the following function to a MySQL query? If so what would be a nice MySQL function to achieve this functionality? public ArrayList getNewTitles(ArrayList candidateTitles, ArrayList existingTitles) { ArrayList newTitles = new ArrayList(); Movie movie = new Movie(); boolean isNew = true; for(int i=0; i<candidateTitles.size(); i++) { for(int j=0; j<existingTitles.size(); j++) { movie = (Movie)existingTitles.get(j); if(((String)candidateTitles.get(i)).equals(movie.getRawTitle())) { isNew = false; } } if(isNew == true) { System.out.println("newTitle for crawling: " + (String)candidateTitles.get(i)); newTitles.add((String)candidateTitles.get(i)); } else { System.out.println("candidate binned: " + (String)candidateTitles.get(i)); } isNew = true; } return newTitles; }

    Read the article

  • How to rewrite a path using a custom HttpHandler

    - by Micah
    I'm writing a multi-tenant app that will receive requests like http://www.tenant1.com/content/images/logo.gif and http://www.anothertenant.com/content/images/logo.gif. I want the requests to actually map to the folder location /content/tenant1/images/logo.gif and /content/anothertenant/images/logo.gif I'm using asp.net Mvc 2 so I'm sure there's probably a way to setup a route to handle this or a custom route handler? Any suggestions? Thanks!

    Read the article

  • Simple URL rewrite, not redirect, with .htaccess

    - by Ron
    I'm pretty inexperienced with .htaccess so please bear with me. I have a domain - "http://www.exampletest.com" which redirects to a folder at a different domain where I have hosting i.e: "http://www.differenturl.com/exampletest" Is there an easy mod_rewrite rule where I could have anything at "http://www.differenturl.com/exampletest" show up as "http://www.exampletest.com?" An example would be: "http://www.differenturl.com/exampletest/user.php" - "http://www.exampletest.com/user.php" Any assistance is greatly appreciated. I assume this easy so sorry to ask such a basic question. Thanks

    Read the article

  • rewrite image URLs

    - by Don
    Hi, I'm writing a Maven plugin that merges CSS files together. So all the CSS files that match /foo/bar/*.css might get merged to /foo/merged.css. A concern is that in a file such as /foo/bar/baz.css there might be a property such as: background: url("images/pic.jpg") So when the file is merged into /foo/merged.css this will need to be changed to background: url("bar/images/pic.jpg") The recalculated URL obviously depends on 3 factors: original URL original CSS file location merged CSS file location Assuming that the original and merged CSS files are both on the same filesystem, is there a general formula (or Java library) that can be used to calculate the new url given these 3 inputs? Thanks, Don

    Read the article

  • Problem with routes and mod-rewrite (if not absolute i don't get CSS, JS or images)

    - by Toni Michel Caubet
    hi there! i updated the code from my website to a 'better' veersion i think, it works fine but when i try to implement the friendly URL and load it, works, but with no CSS, Javascript or images, but if i corret the routes for the css to http://website/css/style.css (instead of ./css/style.css) it i do see the CSS properly loaded, any idea why? Example: http://keepyourlinks.com/link1.php?id=25 VS http://keepyourlinks.com/keep/25/series-yonkis (i updated the route of the CSS, but the Javascript is missing an the images asweell) I really would like not to have to correct al routes :(

    Read the article

  • PHP unlink OR rewrite own/current file by itself

    - by Email
    Hi Task: Cut or erase a file after first walk-through. i have an install file called "index.php" which creates another php file. <? /* here some code*/ $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "<?php \n echo 'hallo, *very very long text*'; \n ?>"; fwrite($fh, $stringData); /*herecut"/ /*here some code */ after the creation of the new file this file is called and i intent to erase the filecreation call since it is very long and only needed on first install. i therefor add to the above code echo 'hallo, *very very long text*'; \n ***$new= file_get_contents('index.php'); \n $findme = 'habanot'; $pos = strpos($new, $findme); if ($pos === false) { $marker='herecut';\n $new=strstr($new,$marker);\n $new='<?php \n /*habanot*/\n'.$new;\n $fh = fopen('index.php', 'w') or die 'cant open file'); $stringData = $new; fwrite($fh, $stringData); fclose($fh);*** ?>"; fwrite($fh, $stringData);]} Isnt there an easier way or a function to modify the current file or even "self destroy" a file after first call? Regards

    Read the article

  • SEO Url Redirect/Rewrite Using Database Managed Links

    - by user204245
    I have searched left and right. And i am trying to find a script or a method on how I can store links in database and use them for redirection. This is an E-commerce project and I am looking for something to manage Product and system URL from database. Something Similar like magneto dose. Basically anything after the domain say like domain.com/demo/12/my_iphone so now demo/12/my_iphone will be sent to database for querry and in databases there will be a destination URL which could be productlisting.php?searchstring=iphones so the user will see link domain.com/demo/12/my_iphone but actualy he will be seeing productlisting.php?searchstring=iphones basically demo/12/my_iphone = productlisting.php?searchstring=iphones and tomorrow if the user want to edit demo/12/my_iphone to demo/12/myiphone he can just do so using simple form which will update in the database. How can i achieve this ?

    Read the article

  • How can i rewrite this query for faster execution

    - by sam
    SELECT s1.ID FROM binventory_ostemp s1 JOIN ( SELECT Cust_FkId, ProcessID, MAX(Service_Duration) AS duration FROM binventory_ostemp WHERE ProcessID='4d2d6068678bc' AND Overall_Rank IN ( SELECT MIN(Overall_Rank) FROM binventory_ostemp WHERE ProcessID='4d2d6068678bc' GROUP BY Cust_FkId ) GROUP BY Cust_FkId ) AS s2 ON s1.Cust_FkId = s2.Cust_FkId AND s1.ProcessID=s2.ProcessID AND s1.Service_Duration=s2.duration AND s1.ProcessID='4d2d6068678bc' GROUP BY s1.Cust_FkId It just goes away if there are more than 10K rows in that table. What it does is find rows for each customer who has min. of overall rank and in those max. of service duration for a given processid Table Data ID Cust_FkId Overall_Rank Service_Duration ProcessID 1 23 2 30 4d2d6068678bc 2 23 1 45 4d2d6068678bc 3 23 1 60 4d2d6068678bc 4 56 3 90 4d2d6068678bc 5 56 2 50 4d2d6068678bc 6 56 2 85 4d2d6068678bc

    Read the article

  • .htacces Rewrite Rule to Keep .php File Extensions

    - by user2672112
    I'm upgrading my static website that had .php extensions on the content pages. I've created my own simple cms which will start retrieving data from mysql database from now on, keeping the url structure same as the old once. The cms has get function to retrieve url structure from the database. Overall it started working fine with .html when i tested. But when i change the .html extension to .php in my .htaccess code the content pages starts reflecting "Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request." Here is my .htaccess code which i've used: RewriteBase / Options +FollowSymLinks RewriteEngine On RewriteRule ^([^?]*).php$ content.php?pid=$1 Perhaps there is a conflict, here is the code with .html extension that actually works fine. RewriteBase / Options +FollowSymLinks RewriteEngine On RewriteRule ^([^?]*).html$ content.php?pid=$1 So basically, content pages with .html are working & .php are not working. But i need my content pages to be with .php Please help. Thanks in advance... :)

    Read the article

  • shell script stopped working --- need to rewrite?

    - by OopsForgotMyOtherUserName
    The script below worked on my Mac OS X. I'm now using Ubuntu OS, and the script is no longer working. I'm wondering if there's something that I need to change here? I did change the first line from #!/bin/bash to #!/bin/sh, but it's still throwing up an error.... Essentially, I get an error when I try to run it: Syntax error: end of file unexpected (expecting ")") #!/bin/sh REMOTE='ftp.example.com' USER='USERNAME' PASSWORD='PASSWORD' CMDFILE='/jtmp/rc.ftp' FTPLOG='/jtmp/ftplog' PATTERN='SampFile*' date > $FTPLOG rm $CMDFILE 2>/dev/null LISTING=$(ftp -in $REMOTE <<EOF user $USER $PASSWORD cd download ls $PATTERN quit EOF ) echo "open $REMOTE" >> $CMDFILE echo "user $USER $PASSWORD" >> $CMDFILE echo "verbose" >> $CMDFILE echo "bin" >> $CMDFILE echo "cd download" >> $CMDFILE for FILE in $LISTING do echo "get $FILE" >> $CMDFILE done echo "quit" >> $CMDFILE ftp -in < $CMDFILE >> $FTPLOG 2>&1 rm $CMDFILE

    Read the article

  • HTACCESS Rewrite on directories

    - by Cameron
    I have the following code in my Root htaccess file RewriteCond %{HTTP_HOST} ^paperviewmagazine.com RewriteRule (.*) http://www.paperviewmagazine.com/$1 [R=301,L] It works fine for the main site, but for my forums at /forums/ if someone misses off the www it will show the page and not redirect to the www.paperviewmagazine.com/forums/ instead. I need to force the WWW to prevent anyone from logging in by accident on the non-www as it wont have the correct cookie credentials for accessing the site at www./forums/ Can anyone help? Thanks.

    Read the article

  • Rewrite code from Threads to AnyEvent

    - by user1779868
    I wrote a code: use LWP::UserAgent; use HTTP::Cookies; use threads; use threads::shared; $| = 1; $threads = 50; my @urls : shared = loadf('url.txt'); my @thread_list = (); $thread_list[$_] = threads->create(\&thread) for 0 .. $threads - 1; $_->join for @thread_list; thread(); sub thread { my ($web, $ck) = browser(); while(1) { my $url = shift @urls; if(!$url) { last; } $code = $web->get($url)->code; print "[+] $url - code: $code\n"; if($code == 200) { open F, ">>200.txt"; print F $url."\n"; close F; } elsif($code == 301) { open F, ">>301.txt"; print F $url."\n"; close F; } else { open F, ">>else.txt"; print F "$url code - $code\n"; close F; } } } sub loadf { open (F, "<".$_[0]) or erroropen($_[0]); chomp(my @data = <F>); close F; return @data; } sub browser { my $web = new LWP::UserAgent; my $ck = new HTTP::Cookies; $web->cookie_jar($ck); $web->agent('Opera/9.80 (Windows 7; U; en) Presto/2.9.168 Version/11.50'); $web->timeout(5); return $web, $ck; } After its working for some time physical storage is full. Can u help me to re-write it with AnyEvent. I tried but my code didn't work. I read that it will help me to safe some memory. Thanks a lot to any helpers.

    Read the article

  • Stop Rewrite htaccess create random pages

    - by Vistol
    Recently I saw in my Webmaster tools that some random sites are linking to my site. Actually this is not an big issue. The issue comes when the pages that are linked are not real pages because of my httaccess file. This is the htaccess code that Im running: <pre> #Options +FollowSymLinks RewriteEngine on RewriteRule ^([^/\.]+)/?$ index.php?id=$1 [L] RewriteRule ^([0-9]+)/(.*)$ index.php?id=$1 [L] </pre> So the real URLs would be: mysite.com/folder/999/TITLE-OR-NAME But cecause I only check the 1st folder ($1) which is an I numberD, this htaccess file is allowing hackers linking to my site with random URLs like: mysite.com/folder/999/TITLE-OR-NAME1 mysite.com/folder/999/TITLE-OR-NAME2 mysite.com/folder/999/TITLE-OR-NAME3 mysite.com/folder/999/TITLE-OR-NAME4 mysite.com/folder/999/TITLE-OR-NAME5 The worst part comes when google tells me that I am duplicating content!!! Actually I am not duplicating content, the htaccess is duplicating it for me. And yes I know, Im a bad newbie programmer but Id really appreciate your help with this cause Im struggling to find a solution but it never. Thank you very much for all your support to this newbie :)

    Read the article

  • Rewrite the foreach using lambda + C#3.0

    - by Newbie
    I am tryingv the following foreach (DataRow dr in dt.Rows) { if (dr["TABLE_NAME"].ToString().Contains(sheetName)) { tableName = dr["TABLE_NAME"].ToString(); } } by using lambda like string tableName = ""; DataTableExtensions.AsEnumerable(dt).ToList().ForEach(i => { tableName = i["TABLE_NAME"].ToString().Contains(sheetName); } ); but getting compile time error "cannot implicitly bool to string". So how to achieve the same.? Thanks(C#3.0)

    Read the article

  • jQuery: How do I rewrite .after( content, content )?

    - by Evan Carroll
    I've got this form working, but according to my previous question it might not be supported: it isn't in the docs either way -- but the intention is pretty obvious in the code. $(".section.warranty .warranty_checks :last").after( $('<div class="little check" />').click( function () { alert('hi') } ) , $('<span>OEM</span>') /*Notice this (a second) argument */ ); What this does is insert <div class="little check"> with a simple .click() callback, followed by a sibling of <span>OEM</span>. How else can I write this then? I'm having difficulty conjuring something working by chaining any combination of .after(), and .insertAfter()? I would expect this to work, but it doesn't: $(".section.warranty .warranty_checks :last").after( $('<div class="little check" />').click( function () { alert('hi') } ).after ( $('<span>OEM</span>') ) ); I would also expect this to work, but it doesn't: $(".section.warranty .warranty_checks :last").after( $('<span>OEM</span>').insertAfter( $('<div class="little check" />').click( function () { alert('hi') } ) ); );

    Read the article

  • How to rewrite the following?(C#3.0)

    - by Newbie
    I am trying to write the following double sum_res = 0.0; double yhat = 0; double res = 0; int n = 0; for(int i=0;i<x.Count;i++) { yhat = inter + (slp*x[i]); res = yhat - y[i]; n++; } using lambda but somehow not able to get it work(compile time error) Enumerable.Range(0, x.Count).Select(i => { yhat = inter + (slp * x[i]); res = yhat - y[i]; sum_res += res * res; n++; }); Error: The type arguments for method 'System.Linq.Enumerable.Select(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. Help needed. Thanks

    Read the article

  • rewrite routes for URl

    - by user348173
    I have the following URl: http://localhost:12981/BaseEvent/EventOverview/12?type=Film This is route: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); I want that in a browser the url looks like: http://localhost:12981/Film/Overview/12 How can I do this? One more example: http://localhost:12981/BaseEvent/EventOverview/15?type=Sport should be http://localhost:12981/Sport/Overview/15 Thanks.

    Read the article

  • exclude the folders - url rewrite in htaccess

    - by aquagirl
    rewriteCond %{REQUEST_URI} ^(ajax|css|functions|image_viewer|images|img|include|fancybox|jquery|jscript|json)$ - [L] RewriteRule ^(.[^/])/(.[^/])/(.+[^/]) ?program=$1&usertype=$2&username=$3 [NC] could you please help me find what is wrong in this.. ? I need to exclude some folders from url rewriting. i tried with the solution given here.. but still i am getting some errors.. http://www.idxsync.com/sbaor/Search/Agent/zz please help me

    Read the article

  • scala: how to rewrite this function using for comprehension

    - by opensas
    I have this piece of code with a couple of nasty nested checks... I'm pretty sure it can be rewritten with a nice for comprehension, but I'm a bit confused about how to mix the pattern matching stuff // first tries to find the token in a header: "authorization: ideas_token=xxxxx" // then tries to find the token in the querystring: "ideas_token=xxxxx" private def applicationTokenFromRequest(request: Request[AnyContent]): Option[String] = { val fromHeaders: Option[String] = request.headers.get("authorization") val tokenRegExp = """^\s*ideas_token\s*=\s*(\w+)\s*$""".r val tokenFromHeader: Option[String] = { if (fromHeaders.isDefined) { val header = fromHeaders.get if (tokenRegExp.pattern.matcher(header).matches) { val tokenRegExp(extracted) = header Some(extracted) } else { None } } else { None } } // try to find it in the queryString tokenFromHeader.orElse { request.queryString.get("ideas_token") } } any hint you can give me?

    Read the article

  • How can I rewrite this (cleanly) without gotos?

    - by Jared P
    How can I do this cleanly without gotos? loop: if(condition1){ something(); } else if (condition2) { somethingDifferent(); } else { mostOfTheWork(); goto loop; } I'd prefer not to use breaks as well. Furthermore, it is expected to loop several (adv 40) times before doing something else, so the mostOfTheWork part would most likely be as high up as possible, even if just for readability. Thanks in advance.

    Read the article

  • Rewrite subfolder URL so it appears differently

    - by pg
    I want to change the URL that appears when you go to: MYSUBDOMAIN.MYCOMPANY.COM/carbonated-milk/ to: carbonated-milk.com/ I'm trying to figure out what to put in my .htaccess folder to do this and I've been reading through all kinds of doc files and through other peoples' questions on stackoverflow but can't come up with an answer for this. Do any of you have any idea?

    Read the article

  • rewrite condition for directory along with file

    - by RHR
    Any one please help me.I am new to .htaccess I want to check the following condition RewriteCond : IF !index.html AND !app/facebookapp/{[a-zA-Z0-9-/]}.html RewriteRule : ..... My code is RewriteCond %{REQUEST_URI} !index\.html RewriteCond %{REQUEST_URI} app/facebookapp/^([a-zA-Z0-9-/]+).html$ RewriteRule ...... its not working And one more question if the request url is header.html RewriteCond %{REQUEST_URI} header.html$ RewriteRule ^([a-zA-Z0-9-/]+).html$ position.php?position=$1 [L] $l will return header. if the request url is app/facebookapp/header.html we write the same above condition $l will return app/facebookapp/header.my question is how to get only the filename ?? thanks

    Read the article

  • .htaccess redirect / rewrite

    - by Itg
    Hello, I am trying to redirect from: domain.com/uploads/$ to domain.com/download.php?file=$ $ being the variable. I have tried many different ways but do not seem to be redirecting, I've tried, R=301,L,QSA and in various different orders. Anyone help? Thanks!

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >