小编Mar*_*inW的帖子

PHP重写规则

我的应用使用的实际网址是:

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)

这可能吗?谢谢.

.htaccess mod-rewrite

7
推荐指数
2
解决办法
2万
查看次数

Mod-rewrite已经显露出来了

我认为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)

我把这完全混淆了吗?

apache mod-rewrite

3
推荐指数
1
解决办法
164
查看次数

使用适用于iPhone的NSXMLParser处理RSS标签

我发现以下代码用于解析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)

xml cocoa-touch

1
推荐指数
1
解决办法
1991
查看次数

标签 统计

mod-rewrite ×2

.htaccess ×1

apache ×1

cocoa-touch ×1

xml ×1