Hi devs!
I have seen urls like website.com/admin/ that don't actually show the "index.html" or file name after the last slash. How is this achieved?
Thank you!
So this is a really simple question, I just can't find the answer. I have some text in a UITextView, that I would like to have show as blue, and serve as a link to a website. How do I do that in interface builder? Thanks
i need to know how to pass everything after the .php part in this link
"http://wreckedclothing.net/help/[email protected]&t=985559"
to a iframe on the same page. "hosted on the same site"
like this
"<iframe>
src="http://www.wreckedclothing.net/[email protected]&t=985559"
frameborder="0"
width="829"
name="tree"></iframe>
see how it adds everything to the link in src
I have the following code:
<a href="www.localhost/Project/Show.action?test=abc"> Test </a>
And I want when I click on it to show the "test" parameter in the next page.
How can be done in Struts2?
Thanks.
Consider the case of blogspot.com the domain is the one blogspot.com only but suppose i register in it with xxx then i will have xxx.blogspot.com like wise here it won't be the subdomain (i can smell) , but its some thing different ... how to achieve this ??
in j2ee web application..
I would like to be able to map URLs to Controllers dynamically based on information in my database.
I'm looking to do something functionally equivalent to this (assuming a View model):
map.route '/:view_name',
:controller => lambda { View.find_by_name(params[:view_name]).controller }
Others have suggested dynamically rebuilding the routes, but this won't work for me as there may be thousands of Views that map to the same Controller
I'm looking for a java web framework that will allow you to configure dynamic urls where information is being passed to the controller.
For example
/{clientName}/login
would call the same controller regardless of the clientName and pass that clientName as an accessible value or an object in it's own right.
How to dynamically create urls/links like:
www.restaurant.com/restaurant/restaurant-name-without-some-characters-like-space-coma-etc/132
what are the keywords i can use to google some articles on this topic? (how to genererate and handle this kind of urls inside asp.net mvc)
There are some questions:
How to generate links? (store slugs in db?)
Redirect or not if slug isn't canonical?
edit: apparently they are called slugs
iam using ruby on rails
i have models
-category
-subcategory
-city
-firm
when i click on category it will show sub categories and permalink should be: xxx.com/category
when i click subcategory it will show firms and city names. xxx.xom/category/subcategory
when i clikc on city name it will filter firms belongs to that city xxx.com/category/subcategory/city
when i clikc on firm name it will show xxx.com/category/subcategory/city/firm-name
firms may have more than one sub category
i used premalink_fu but i could not do that sub category system.
category,subcategory,city,firm tables have their own permalink field on db.
but i dont know how to combine them dynamically.
i can do xxx.com/category but icant do xxx.com/category/subcategory
how can i do that please help me
Following code always fails
URL url = new URL("http://userserve-ak.last.fm/serve/126/8636005.jpg");
Image img = ImageIO.read(url);
System.out.println(img);
I've manually checked the url, and it is valid, and contains a valid jpg image.
The problem I get is;
Exception in thread "main" javax.imageio.IIOException: Can't get input stream from URL!
at javax.imageio.ImageIO.read(ImageIO.java:1385)
at maestro.Main2.main(Main2.java:25)
Caused by: java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:310)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:176)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
at java.net.Socket.connect(Socket.java:546)
at java.net.Socket.connect(Socket.java:495)
at sun.net.NetworkClient.doConnect(NetworkClient.java:174)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:409)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
at sun.net.www.http.HttpClient.(HttpClient.java:240)
at sun.net.www.http.HttpClient.New(HttpClient.java:321)
at sun.net.www.http.HttpClient.New(HttpClient.java:338)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:814)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:755)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:680)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1005)
at java.net.URL.openStream(URL.java:1029)
at javax.imageio.ImageIO.read(ImageIO.java:1383)
... 1 more
Java Result: 1
What does this mean?
Funny thing is, if I change my internet-connection to that of the neighbour's wireless, it suddenly does work.
My site was under example.com/waha/
Now I move the site right under the root example.com
I want to 301 redirect all the old links like example.com/waha/notice/5803 to example.com/notice/5803
How can I do it?
My current .htaccess file is below.
<IfModule mod_rewrite.c>
RewriteEngine On
# NOTE: change this to your actual StatusNet path; may be "/".
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?p=$1 [QSA,L]
</IfModule>
<FilesMatch "\.(ini)">
Order allow,deny
</FilesMatch>
Options -Indexes
Hello,
I am trying to make my site look more professional by removing the html endings from the pages..
ex. just leaving at http://33tpm.com/es/tienda
All the answers Ive found so far are so confusing that I don't really understand anything..
Can someone please help me out?
Thank you
Thomas
Apache web hosts have a user-configurable ~/.htaccess file that allows local redirects, for example, www.awesomesite.com = www.awesomesite.com/launchmyawesomeapp.cgi
In lighttpd I know there is a global /etc/lighttpd.conf file, but is there something local like the Apache htaccess file?
thanks,
joe
I'm building a user content parser and am adding an automatic link parser. I'm adding a dialogue, that confirms that the user wants to go to the particular site being linked to. This is for two reasons. Anti phishing and spam combating. However I want to be able to disable both the dialogue and nofollow additions with commonly used websites, so I'm building a whitelist. Are there any common whitelists about or should I start building one from scratch?
I'm attempting to setup a retweet button with some pre-written post text.
However I need to place a pound sign in like so:
£50k
I've search the web and for the UK currency sign I've been told it is supposed to be replaced with the code: %a3
However when I attempt to click on the link I get the error message:
"Invalid Unicode value in one or more parameters"
This is the document declaration at the top of the html page I'm using:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
I have a website in three languages with a directory for each: i.e. /en-US/, /de-DE/ and /fr-FR/. I would like the web server to use the browser's accept-language string to return content in the language of the user.
Examples:
(a) "pl-PL;fr-FR;en-US" should redirect to /fr-FR/.
(b) "de;fr-FR" redirects to /de-DE/
(c) "jp-JP" redirects to /en-US/.
How would I do this in an .htaccess file?
I'm trying to write a rule to make that one can generalize, since multiple pages to pass the values are different. Right now I could do:
RewriteRule ^forum/([^/]{1,255})/([\+]{1})/((([a-z]+)([_]{1})([a-zA-Z0-9]+)([/]?))+)$ forum.php?name=$1&$5=$7 [L]
To address such as:
Nome+del+Forum/+/page_1/action_do
Should return:
forum.php?name=Nome+del+Forum&page=1&action=do
Instead, take only the last parameter (in this case action=do):
forum.php?name=Nome+del+Forum&action=do
How can I fix? Thanks in advance!
I've been working with a new installation of the "MoinMoin" wiki software. As I was playing with it, typing in mostly random test pages, I created a link with a fragment
blah blah see also [[SomeStuff#whatever|some other stuff about whatever]]
Then I needed to figure out how to create the anchor for that "whatever" fragment identifier. I don't recall having to do that with MediaWiki, so I had to dig around, but finally I found that MoinMoin has an "Anchor" macro:
== Whatever ==
<<Anchor(whatever)>>
Looking at the generated HTML, I was surprised to see an empty <span> tag with an "id" value of "whatever". I expected that it'd be an <a> tag with a "name" attribute of "whatever". I dug around and found the source, and there's a comment that says they changed it from an <a> tag in order to avoid some IE problem with <pre> sections. This confused me — not because of the IE thing, but because it looked to me as if their "fix" had left the whole anchor mechanism completely broken.
Much to my surprise, however, further testing indicated that it worked fine. I wrote a test page with 300 <span> tags all with "id" values, and I further shocked myself when Firefox behaved exactly as I would have expected it to had I used <a> tags. It also worked when I changed all the <span> tags to <em>.
So by this time, you're either as surprised as I was, or else you're thinking "how can somebody that dumb have so many reputation points?" If you're in the second category, is it really the case that I've been typing in HTML for about 15 years now — a lot of HTML — and it's somehow escaped my notice that browsers use the HTML fragment to find any sort of element with a matching "id"?
mind status: blown
i have urls like
http://mysite.com/index.php?p=resources
http://mysite.com/index.php?p=resources&s=view&id=938
but i want urls like
http://mysite.com/resources
http://mysite.com/resources/view/938
instead of making hundreds of rewrite rules i wonder if it would be possible to just have one? Ive head this is possible by "getting the uri and splitting it into parts" and then just add a rewrite rule for index.php
but how? could someone give an example or link a tutorial
I'm trying to write a rule to make that one can generalize, since multiple pages to pass the values are different. Right now I could do:
RewriteRule ^forum/([^/]{1,255})/([\+]{1})/((([a-z]+)([_]{1})([a-zA-Z0-9]+)([/]?))+)$ forum.php?name=$1&$5=$7 [L]
To address such as:
Nome+del+Forum/+/page_1/action_do
Should return:
forum.php?name=Nome+del+Forum&page=1&action=do
Instead, take only the last parameter (in this case action=do):
forum.php?name=Nome+del+Forum&action=do
How can I fix? Thanks in advance!
This is what my .htaccess looks like. The .htaccess is sitting in /www/scripts directory which is the parent of codeigniter's "system" directory and which also contains index.php. I have enabled mod_rewrite in my Apache 2.2.x. This is on Ubuntu 9.10 server.
I followed this link, but it does not work. Is there anything i need to do in apache2, any specific configuration so that this works??
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
Hi,
I'm working with Symfony 1.2. I've a view with a list of objects. I can order them, filter them by category, or moving to the next page (there is pagination). Everything is done with AJAX, so I don't have to load all the page again.
What I want to achieve is to have http://urltopage#page=1&order=title&cats=1,2 for example; so the new page is saved in the browser history, and he can paste it to another web.
I haven't found a way to get the #part. I know that's only for the browser but I can't believe I can't get through PHP. I'm sure there is a simple solution I'm missing...
thanks a lot!
Hi.
I have some folder with different files.
I want to use something like this: http://myserver.com/foo/bar/test.html
I'm using this way to obtain path:
"/excursion/$path**" (controller:"excursion", action:"sweet")
But it doesn't helps with file extensions... How to disable file extensions truncating ?
This is my controller:
class Timesheet extends Controller {
...
function index() {
//loads view with a form that submits to "timesheet/change_date"
}
function summary() {
//loads view with a form that submits to "timesheet/change_week"
}
function change_date() {
...
redirect('timesheet');
}
function change_week() {
...
redirect('timesheet/summary');
}
...
}
The first form is located at http://localhost/dts/index.php/timesheet and when I submit the change_date form, it correctly goes thru the change_date() function and re-loads http://localhost/dts/index.php/timesheet correctly.
However, the second form is located at http://localhost/dts/index.php/timesheet/summary, and when I submit the change-week form, it goes thru the change_week() function but goes to http://localhost/dts/index.php/timesheet/timesheet/change_week. Notice the word timesheet is repeated. When I submit the form again, another timesheet is added.
What's wrong and how do I improve my code?
My .htaccess is below:
RewriteEngine on
RewriteCond $1 !^(index\.php|webroot|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]