Search Results

Search found 711 results on 29 pages for 'trailing slash'.

Page 6/29 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • htaccess - Redirects with more than 1 slash not working

    - by barfoon
    Hey everyone, Just moved to shared hosting on GoDaddy and Im trying to get my .htaccess rules working. Heres what I have: ErrorDocument 404 /error.php Options FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.mydomain\.org$ RewriteRule ^(.*)$ http://mydomain.org/$1 [R=301,L] RewriteRule ^view/(\w+)$ viewitem.php?itemid=$1 [R=301,L] RewriteRule ^category/(\w+)$ viewcategory.php?tag=$1 [R=301,L] RewriteRule ^faq$ faq.php RewriteRule ^about$ about.php RewriteRule ^contact$ contact.php RewriteRule ^submit$ submit.php RewriteRule ^contactmsg$ handler-contact.php All the pages @ the root of the domain seem to be working i.e mydomain.org/faq, mydomain.org/about are working. But whenever I try mydomain.org/category/somecategory, I get a 404. How can I fix my .htaccess to obey these rules that are more than 1 level deep? Thanks,

    Read the article

  • Mod_rewrite and redirects with training forward slash not working

    - by john williams
    I'm using the following lines of code in my .htaccess file to create redirects. The problem is, whenever I go to example.com/register/ it cant find the css files because it's looking for example.com/register/mycss.css instead of example.com/mycss.css. Redirect 301 register.php http://example.com/register RewriteRule ^register/?$ register.php How can I correct this? I'm new to any kind of htaccess/mod_rewrite functions so feel free to point me in the right direction if there are any other flaws.

    Read the article

  • how to prevent database to add slash to quotes

    - by black sensei
    i know this sounds really common and so trivial but , am having a challenge here. I have a web site with Zend/Doctrine and i use ckeditor for the backend management. after uploading the site i've realized that during edit testing the look and feel of the site is messed up. with the help of firebug, i've seen that there are slashes all over the html. after inline edition, the look and feel came back to normal. There are so many files , i can't think of doing other decoding before outputting data from mysql. What options do i have to solve this problem. the site is up already and i feel a bit unconfortable about this. Can anyone give a hint? thanks

    Read the article

  • "slash before every quote" problem

    - by Camran
    I have a php page which contains a form. Sometimes this page is submitted to itself (like when pics are uploaded). I wouldn't want users to have to fill in every field again and again, so I use this as a value of a text-input inside the form: value="<?php echo htmlentities(@$_POST['annonsera_headline'],ENT_COMPAT,'UTF-8');?>"> This works, except it adds a "\" sign before every double-quote... For instance writing 19" wheels gives after page is submitted to itself: 19\" wheels And if I don't even use htmlentities then everything after the quotes dissappears. What is the problem here?

    Read the article

  • URL structure preference - to slash or not to slash?

    - by TheDeadMedic
    I'm using custom post types in WordPress 3.0 to manage 'courses' (or seminars, lectures, whatever term you'd prefer to have in mind). Now for viewing a single 'course', the url structure is; /course/course-name/ But for multiple courses? /courses/category/category-name/ Or... /course-category/category-name/ Or something entirely different?

    Read the article

  • removing forward slash in .htaccess

    - by user1083644
    I am using Jobbersbase for my online job portal. In which i have given link to my main webpage page like this http://www.mydomain.com/aboutus.html, but its not working because the link is taking '/' at the end http://www.mydomain.com/aboutus.html/ I tried adding RewriteCond %{REQUEST_FILENAME}\.html -f in .htaccess , if i add that other links doesnt work which has / for example http://www.mydomain.com/jobs/ Now my .htaccess looks like this # AddType x-mapp-php5 .php # AddHandler x-mapp-php5 .php RewriteEngine On RewriteCond %{REQUEST_URI} .*/$ RewriteRule (.*)/$ $1 ErrorDocument 404 /page-unavailable/ <files ~ "\.tpl$"> order deny,allow allow from none deny from all </files> Someone please suggest me how to do it thanks

    Read the article

  • Avoid trailing zeroes in printf()

    - by Gorpik
    I keep stumbling on the format specifiers for the printf() family of functions. What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point. If I use: printf("%1.3f", 359.01335); printf("%1.3f", 359.00999); I get 359.013 359.010 Instead of the desired 359.013 359.01 Can anybody help me?

    Read the article

  • XML/PHP : Content is not allowed in trailing section

    - by Tristan
    Hello, i have this message error and i don't know where does the problem comes from: <?php include "DBconnection.class.php"; $sql = DBConnection::getInstance(); $requete = "SELECT g.siteweb, g.offreDedie, g.coupon, g.only_dedi, g.transparence, g.abonnement , s.GSP_nom as nom , COUNT(s.GSP_nom) as nb_votes, TRUNCATE(AVG(vote), 2) as qualite, TRUNCATE(AVG(prix), 2) as rapport, TRUNCATE(AVG(serviceClient), 2) as serviceCli, TRUNCATE(AVG(interface), 2) as interface, TRUNCATE(AVG(services), 2) as services FROM votes_serveur AS v INNER JOIN serveur AS s ON v.idServ = s.idServ INNER JOIN gsp AS g ON s.GSP_nom = g.nom WHERE s.valide = 1 GROUP BY s.GSP_nom"; $sql->query($requete); $xml = '<?xml version="1.0" encoding="UTF-8" ?><GamerCertified>'; while($row = $sql->fetchArray()){ $moyenne_services = ($row['services'] + $row['serviceCli'] + $row['interface'] ) / 3 ; $moyenne_services = round( $moyenne_services, 2); $moyenne_ge = ($row['services'] + $row['serviceCli'] + $row['interface'] + $row['qualite'] + $row['rapport'] ) / 5 ; $moyenne_ge = round( $moyenne_ge, 2); $xml .= '<GSP>'; $xml .= '<nom>'.$row["nom"].'</nom>'; $xml .= '<nombre-votes>'.$row["nb_votes"].'</nombre-votes>'; $xml .= '<services>'.$moyenne_services.'</services>'; $xml .= '<qualite>'.$row["qualite"].'</qualite>'; $xml .= '<prix>'.$row["rapport"].'</prix>'; $xml .= '<label-transparence>'.$row["transparence"].'</label-transparence>'; $xml .= '<moyenne-generale>'.$moyenne_ge.'</moyenne-generale>'; $xml .= '<serveurs-dedies>'.$row["offreDedie"].'</serveurs-dedies>'; $xml .= '</GSP>'; } $xml .= '</GamerCertified>'; echo $xml; Thanks

    Read the article

  • How to get strptime to raise ArgumentError with garbage trailing characters

    - by Matt Briggs
    We have to handle user specified date formats in our application. We decided to go with Date.strptime for parsing and validation, which works great, except for how it just ignores any garbage data entered. Here is an irb session demonstrating the issue ree-1.8.7-2010.01 > require 'date' => true ree-1.8.7-2010.01 > d = Date.strptime '2001-01-01failfailfail', '%Y-%m-%d' => #<Date: 4903821/2,0,2299161> ree-1.8.7-2010.01 > d.to_s => "2001-01-01" what we would like, is behavior more like this ree-1.8.7-2010.01 > d = Date.strptime '2001failfailfail-01-01', '%Y-%m-%d' ArgumentError: invalid date Any suggestions would be appreciated

    Read the article

  • Removing trailing newline character from fgets() input

    - by sfactor
    i am trying to get some data from the user and send it to another function in gcc. the code is something like this. printf("Enter your Name: "); if(!(fgets(Name, sizeof Name, stdin) != NULL)) { fprintf(stderr, "Error reading Name.\n"); exit(1); } However, i find that it has an \n character in the end. so if i enter John it ends up sending John\n. so how do i remove that \n and send a proper string.

    Read the article

  • nginx improperly forwards to https, adds two trailing slashes when rewriting

    - by Kevin
    I'm using nginx as a proxy for a django project on mod_wsgi and to serve the static content. I have two domain names for it: asdf-example.com and asdfexample.com. I want to use rewrites to redirect everything to www.asdf-example.com They're not quite working the way they should: asdf-example.com forwards to https:// www.asdf-example.com, which fails because I'm not using SSL. Though asdf-example.com/search forwards to http://.... asdfexample.com and www.asdfexample.com both forward to www.asdf-example.com//, which looks weird. My config file: server { listen 80; server_name asdf-example.com asdfexample.com; if ($host ~* ^asdf-example\.com){ rewrite ^(.*)$ http://www.asdf-example.com/$1 permanent; } if ($host ~* ^asdfexample\.com){ rewrite ^(.*)$ http://www.asdf-example.com/$1 permanent; } if ($host ~* ^www\.asdfexample\.com){ rewrite ^(.*)$ http://www.asdf-example.com/$1 permanent; } ... Thanks

    Read the article

  • XSD string pattern independent of leading/trailing space

    - by AndiDog
    I have a XSD simple type that should match UUIDs: <simpleType name="UuidT"> <restriction base="string"> <pattern value="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}" /> </restriction> </simpleType> It correctly matches the following content: <!-- valid --> <Uuid>12345678-1234-5678-9012-123456789012</Uuid> But it doesn't match content that contains excess whitespace: <!-- not valid --> <Uuid> 2de25a81-b117-4b2a-b910-50f0878884f7 </Uuid> Sure, I could add \s* to both sides of the regex, but isn't there a simpler solution in XSD?

    Read the article

  • losing leading & trailing space when translated using Google Machine Translation

    - by Sourabh
    Hi , I am using google ajax based translation API like in the below example. google.load("language", "1"); function initialize() { var text = document.getElementById("text").innerHTML; google.language.detect(text, function(result) { if (!result.error && result.language) { google.language.translate(text, result.language, "en", function(result) { var translated = document.getElementById("translation"); if (result.translation) { translated.innerHTML = result.translation; } }); } }); } google.setOnLoadCallback(initialize); When I send string like " how are you? " The transaltion what I get is like "xxx xxx xxxxxxx" . the spaces in the original string are trimmed.How do I prevent it from happening ?

    Read the article

  • Javascript: parseInt() with trailing characters

    - by chris_l
    parseInt("7em", 10); returns 7 in all browsers I tested [*]. But can I rely on this? The reason I ask is, that I want to perform some calculations based on em, like /* elem1.style.top uses em units */ elem2.style.top = parseInt(elem1.style.top, 10) + 1 + "em"; I could do this with regular expressions, but parseInt is easier to use, and probably a bit faster. Or is there another solution (maybe using jQuery)? [*] Tested so far on: IE 6, IE 8, Safari 4, Firefox 3.6, Opera 10.5

    Read the article

  • Get rid of Trailing Numbers in C

    - by Tech163
    For example, #include <stdio.h> int main (int argc, const char * argv[]) { char out = printf("teststring"); printf("%d\n", out); return 0; } will return teststring10. Anyone has an idea how to get rid of the 10? Thanks in advance.

    Read the article

  • How to prevent Google Analytics from adding a second slash between domain and page specific URL when viewing a page?

    - by Jeromy Anglim
    I have a blog http://foo.tumblr.com. I sometimes go to Site Content - All Pages on Google Analytics and then navigate to page listing and then click the icon to take me to that page on my blog. However, instead of opening http://foo.tumblr.com/post/1234/blah.html Google Analytics is opening http://foo.tumblr.com//post/1234/blah.html (i.e., it is adding a second slash between the domain the page specific component of the URL). How can I stop Google Analytics from doing this?

    Read the article

  • Correctly encode characters in a PHP mail form ("I'm" turns to be "I\'m")

    - by Peanuts
    Hello guys, I'm testing a PHP mail form, a very barebones one, found here: <?php if(isset($_POST['submit'])) { //The form has been submitted, prep a nice thank you message $output = '<h3>Thanks for your message</h3>'; //Deal with the email $to = '[email protected]'; $subject = 'you have a mail'; $contactname = strip_tags($_POST['contactname']); $adress = strip_tags($_POST['adress']); $contactemail = strip_tags($_POST['contactemail']); $textmessage = strip_tags($_POST['textmessage']); $boundary =md5(date('r', time())); $headers = "From: My Site\r\nReply-To: [email protected]"; $message = "Name: ".$contactname."\n"; $message .= "Adress: ".$adress."\n"; $message .= "E-mail: ".$contactemail."\n"; $message .= "Message: ".$textmessage."\n"; mail($to, $subject, $message, $headers); } ?> The problem is I'm receiving an unwanted slash "\" everytime I write a single or a double quote in my message, so "I'm" appear as "I\'m" in my mailbox. I know it have to do with the way PHP distinguishes code quotes from only lecture quotes, but I wouldn't know what to add in my form to get it properly running. Any help is appreciated,

    Read the article

  • Encrypt correctly caracters in a PHP mail form ("I'm" turns to be "I\'m")

    - by Peanuts
    Hello guys, I'm testing a PHP mail form, a very barebones one, found here: <?php if(isset($_POST['submit'])) { //The form has been submitted, prep a nice thank you message $output = '<h3>Thanks for your message</h3>'; //Deal with the email $to = '[email protected]'; $subject = 'you have a mail'; $contactname = strip_tags($_POST['contactname']); $adress = strip_tags($_POST['adress']); $contactemail = strip_tags($_POST['contactemail']); $textmessage = strip_tags($_POST['textmessage']); $boundary =md5(date('r', time())); $headers = "From: My Site\r\nReply-To: [email protected]"; $message = "Name: ".$contactname."\n"; $message .= "Adress: ".$adress."\n"; $message .= "E-mail: ".$contactemail."\n"; $message .= "Message: ".$textmessage."\n"; mail($to, $subject, $message, $headers); } ?> The problem is I'm receiving an unwanted slash "\" everytime I write a single or a double quote in my message, so "I'm" appear as "I\'m" in my mailbox. I know it have to do with the way PHP distinguishes code quotes from only lecture quotes, but I wouldn't know what to add in my form to get it properly running. Any help is appreciated,

    Read the article

  • Why does Java automatically decode %2F in URI encoded filenames?

    - by Lucas
    I have a java servlet that needs to write out files that have a user-configurable name. I am trying to use URI encoding to properly escape special characters, but the JRE appears to automatically convert encoded forward slashes (%2F) into path separators. Example: File dir = new File("C:\Documents and Setting\username\temp"); String fn = "Top 1/2.pdf"; URI uri = new URI( dir.toURI().toASCIIString() + URLEncoder.encoder( fn, "UTF-8" ).toString() ); File out = new File( uri ); System.out.println( dir.toURI().toASCIIString() ); System.out.println( URLEncoder.encoder( fn, "UTF-8" ).toString() ); System.out.println( uri.toASCIIString() ); System.out.println( output.toURI().toASCIIString() ); The output is: file:/C:/Documents%20and%20Settings/username/temp/ Top+1%2F2.pdf file:/C:/Documents%20and%20Settings/username/temp/Top+1%2F2.pdf file:/C:/Documents%20and%20Settings/username/temp/Top+1/2.pdf After the new File object is instantiated, the %2F sequence is automatically converted to a forward slash and I end up with an incorrect path. Does anybody know the proper way to approach this issue? The core of the problem seems to be that uri.equals( new File(uri).toURI() ) == FALSE when there is a '%2F' in the URI. I'm planning to just use the URLEncoded string verbatim rather than trying to use the File(uri) constructor.

    Read the article

  • How do I make vim's autoindent not drop trailing spaces?

    - by Joey Adams
    In some text editors (e.g. Kate, gedit), when auto indent is enabled, pressing return twice will leave a trailing whitespace (which I want): if (code) { .... ....| } While others cater to the coding standard where trailing spaces (even in blank lines) aren't allowed: if (code) { ....| } What annoys me about this is that if I arrow up after auto-indenting, the auto-indent is lost: if (code) { | .... } If I run vim and :set autoindent , I get the latter behavior. My question is, how do I set vim to keep the trailing spaces rather than automatically removing them if they go unused?

    Read the article

  • How to avoid trailing spaces when you copy something from terminal?

    - by Michael Härtl
    I often copy a code snippet from a SSH terminal session where i'm logged in to some remote server and have a file opened in vim, for example to paste it here into an answer at SO. It frequently happens, that the code is padded with trailing spaces to match the terminal width. Whereas i've seen this on both, my Ubuntu and Windows machines (using putty) i think, it doesn't happen always. I was not able to figure out when it happens, though. So i wonder how i can avoid those trailing spaces which i have to remove manually all the time in the textarea, where i copy it to. Note, that the files do not have trailing spaces on the server! It only happens if i select and copy some text.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >