我的应用使用的实际网址是:
http://site.com/search.php?search=iPhone
Run Code Online (Sandbox Code Playgroud)
但我希望有可能实现同样的目标
http://site.com/iPhone
Run Code Online (Sandbox Code Playgroud)
我没有重写规则的经验,我该如何设置呢?
解决方案已经奏效,但新URL显示在地址栏中.我认为可以将其设置为好像页面位置一样
http://site.com/iPhone
无需更改显示
http://site.com/search.php?search=iPhone
Run Code Online (Sandbox Code Playgroud)
这可能吗?谢谢.
我认为apache mod_rewrite会隐藏重定向到的URL.即如果用户输入 http://site.com/iPhone 并且我已将其设置为重定向到 http://site.com/search.php?search=iPhone, 我本来期望 http:// site. com/iPhone 仍会显示在地址栏中?
.htaccess文件是:
<IfModule mod_rewrite.c>
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^search/(.*) search.php?search=$1 [R]
</IfModule>
Run Code Online (Sandbox Code Playgroud)
我把这完全混淆了吗?
我发现以下代码用于解析RSS但它似乎不允许嵌套元素:
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
NSLog(@"ended element: %@", elementName);
if ([elementName isEqualToString:@"item"]) {
// save values to an item, then store that item into the array...
[item setObject:currentTitle forKey:@"title"];
[item setObject:currentLink forKey:@"link"];
[item setObject:currentSummary forKey:@"summary"];
[item setObject:currentDate forKey:@"date"];
[item setObject:currentImage forKey:@"media:thumbnail"];
Run Code Online (Sandbox Code Playgroud)
要使用的RSS是:
<item><title>Knife robberies and burglaries up</title>
<description>The number of robberies carried out at knife-point has increased sharply and burglaries are also up, latest crime figures indicate</description>
<link>http://news.bbc.co.uk/go/rss/-/1/hi/uk/7844455.stm</link>
<guid isPermaLink="false">http://news.bbc.co.uk/1/hi/uk/7844455.stm</guid>
<pubDate>Thu, 22 Jan 2009 13:02:03 …Run Code Online (Sandbox Code Playgroud)