URL重写问题
回答
RewriteRule ^index/result_id/([0-9]+)/?$ index.php?result_id=$1
RewriteRule ^index/article/([0-9]+)/?$ articles.php?article_id=$1
RewriteRule ^index/product/([0-9]+)/?$ products.php?productid=$1
将是最好的做
因为Ids不应该以零开始,所以我宁愿做一些类似'^ index/result_id /([1-9] [0-9] *)/?$ index.php?result_id = $ 1'的东西。在你的正则表达式中也有太多关闭的假设。 – 2010-06-21 08:50:14
所以有。是一个错字。我已经[0-9] +来简化更长的数字。谢谢。 – 2010-06-21 08:51:47
你可能不是在你的正则表达式使用空格。尝试减少“bharani”和“$”之间的空间。
RewriteEngine叙述上 重写规则“bharani”和“的index.php” 没有运气上述变化也... – Bharanikumar 2010-06-21 07:48:34
尝试
RewriteRule ^/bharani/?$ index.php
的/?意味着/是可选的。只是柜面人们不把它放在
我现在的URL财产以后像 https://www.atnworld.net/fb/index.php?result_id= 1996 我想改变这个到 https://www.atnworld.net/fb/index/result_id/1996 – Bharanikumar 2010-06-21 08:11:21
我已经添加了另一个答案,所以它会更容易阅读。 – 2010-06-21 08:19:19
事情是这样的:
RewriteRule ^index/([a-zA-Z_-]+)/([0-9]+))/?$ index.php?result_id=$2
或
RewriteRule ^index/result_id/([0-9]+))/?$ index.php?result_id=$1
重写规则^([0-9] +)$的index.php?result_id = $ 1 该片段固定我概率,但一个doublt是我的网址是像 atnworld.net/fb/index/product/result_id/1996 atnworld.net/fb/index/article/result_id/1996 atnworld.net/fb/index/books/result_id/1996 如何让这三个DIFF网址,在重写 – Bharanikumar 2010-06-21 08:23:13
技术上我们已经帮助您的问题。所以你应该发布这些作为其他问题。好像我们正在为你做所有的工作。 – 2010-06-21 08:27:34
缺少.htaccess – Bharanikumar 2010-06-21 08:29:39
- 1. Url重写问题
- 2. 重写URL问题
- 3. URL重写问题
- 4. url重写问题
- 5. URL重写问题
- 6. URL重写问题
- 7. URL重写问题
- 8. URL重写问题
- 9. URL重写问题
- 10. 重写url问题
- 11. URL重写问题
- 12. URL重写问题
- 13. URL重写问题
- 14. URL重写问题
- 15. URL重写问题
- 16. URL重写问题重新写入
- 17. Mod重写问题:用drupal重写url
- 18. .htaccess问题 - URL重写
- 19. 子域URL重写问题
- 20. Url用.htaccess问题重写
- 21. URL重写mod_rewrite的问题
- 22. htaccess url重写问题
- 23. 问题URL重写的.htaccess
- 24. Intelligencia URL重写问题
- 25. 重写URL的Response.redirect问题
- 26. Apache .htaccess,url重写问题
- 27. .htaccess URL重写问题
- 28. 的.htaccess重写URL问题
- 29. .htaccess/url重写问题
- 30. URL重写问题,的WebPack
可能属于对serverfault。 COM。 – cHao 2010-06-21 07:51:10