raksmart活动促销

分享

写回答

发帖

[提问] .htaccess放在FTP看到的根文件夹还是域名的文件夹

国外虚拟主机 国外虚拟主机 6842 人阅读 | 19 人回复

发表于 2011-3-8 18:12:35 | 显示全部楼层 |阅读模式

弄了个小游戏程序  上传开启伪静态 就会出现404
不知道.htaccess是该放在FTP看到的根文件夹还是域名下的文件夹
现在放在域名的那个文件夹的根目录
快乐小游戏 有一个nginx_rewrite.htaccess和.htaccess
.htaccess代码如下
RewriteEngine on
rewritebase /

rewriterule ^index.html$ /index.php?m=index
rewriterule ^my/(.*)\.html$ /index.php?m=about&d=$1

rewriterule ^0/$ /index.php?m=list
rewriterule ^0/index\.html$ /index.php?m=list
rewriterule ^(\d+)/$ /index.php?m=list&typeid=$1
rewriterule ^(\d+)/index\.html$ /index.php?m=list&typeid=$1
rewriterule ^(\d+)/f\.html$ /index.php?m=list&typeid=$1&s=f
rewriterule ^(\d+)/n\.html$ /index.php?m=list&typeid=$1&s=n
rewriterule ^(\d+)/p(\d+)\.html$ /index.php?m=list&typeid=$1&p=$2
rewriterule ^(\d+)/f-(\d+)\.html$ /index.php?m=list&typeid=$1&p=$2&s=f
rewriterule ^(\d+)/n-(\d+)\.html$ /index.php?m=list&typeid=$1&p=$2&s=n

rewriterule ^(\d+)/top\.html$ /index.php?m=top&typeid=$1

rewriterule ^t/$ /index.php?m=zhuanti
rewriterule ^t/index.html$ /index.php?m=zhuanti
rewriterule ^(\w+)/$ /index.php?m=topic&topicpin=$1
rewriterule ^(\w+)/index\.html$ /index.php?m=topic&topicpin=$1
rewriterule ^(\w+)/f\.html$ /index.php?m=topic&topicpin=$1&s=f
rewriterule ^(\w+)/n\.html$ /index.php?m=topic&topicpin=$1&s=n
rewriterule ^(\w+)/p(\d+)\.html$ /index.php?m=topic&topicpin=$1&p=$2
rewriterule ^(\w+)/f-(\d+)\.html$ /index.php?m=topic&topicpin=$1&p=$2&s=f
rewriterule ^(\w+)/n-(\d+)\.html$ /index.php?m=topic&topicpin=$1&p=$2&s=n


rewriterule ^g/(\d+)\.html$ /index.php?m=show&gameid=$1
rewriterule ^g/(\d+)-play\.html$ /index.php?m=play&gameid=$1
rewriterule ^g/(\d+)-screen\.html$ /index.php?m=play-screen&gameid=$1
nginx_rewrite.htaccess代码如下
rewrite ^/index.html$ /index.php?m=index last;
rewrite ^/my/(.*).html$ /index.php?m=about&d=$1 last;

rewrite ^/0/$ /index.php?m=list last;
rewrite ^/0/index.html$ /index.php?m=list last;
rewrite ^/(\d+)/$ /index.php?m=list&typeid=$1 last;
rewrite ^/(\d+)/index.html$ /index.php?m=list&typeid=$1 last;
rewrite ^/(\d+)/f.html$ /index.php?m=list&typeid=$1&s=f last;
rewrite ^/(\d+)/n.html$ /index.php?m=list&typeid=$1&s=n last;
rewrite ^/(\d+)/p(\d+).html$ /index.php?m=list&typeid=$1&p=$2 last;
rewrite ^/(\d+)/f-(\d+).html$ /index.php?m=list&typeid=$1&p=$2&s=f last;
rewrite ^/(\d+)/n-(\d+).html$ /index.php?m=list&typeid=$1&p=$2&s=n last;

rewrite ^/(\d+)/top.html$ /index.php?m=top&typeid=$1 last;

rewrite ^/t/$ /index.php?m=zhuanti last;
rewrite ^/t/index.html$ /index.php?m=zhuanti last;
rewrite ^/(\w+)/$ /index.php?m=topic&topicpin=$1 last;
rewrite ^/(\w+)/index.html$ /index.php?m=topic&topicpin=$1 last;
rewrite ^/(\w+)/f.html$ /index.php?m=topic&topicpin=$1&s=f last;
rewrite ^/(\w+)/n.html$ /index.php?m=topic&topicpin=$1&s=n last;
rewrite ^/(\w+)/p(\d+).html$ /index.php?m=topic&topicpin=$1&p=$2 last;
rewrite ^/(\w+)/f-(\d+).html$ /index.php?m=topic&topicpin=$1&p=$2&s=f last;
rewrite ^/(\w+)/n-(\d+).html$ /index.php?m=topic&topicpin=$1&p=$2&s=n last;


rewrite ^/g/(\d+).html$ /index.php?m=show&gameid=$1 last;
rewrite ^/g/(\d+)-play.html$ /index.php?m=play&gameid=$1 last;
rewrite ^/g/(\d+)-screen.html$ /index.php?m=play-screen&gameid=$1 last;
有什么问题吗 我的是Linux的无限专业型虚拟主机 中文客服说默认开启伪静态了
应该有.htaccess就可以了吧?
还要怎么设置啊 程序后台开启伪静态就404 高手帮个忙看看

回答|共 19 个

微微百科

发表于 2011-3-8 18:26:25 | 显示全部楼层

现在放在域名的那个文件夹的根目录
快乐小游戏 有一个nginx_rewrite.htaccess和.htaccess

你现在所放置的位置是对的。
.htaccess是你上传上去的吗?

twm123

发表于 2011-3-8 18:35:33 | 显示全部楼层

是的呀 程序自带的

微微百科

发表于 2011-3-8 18:41:38 | 显示全部楼层

回复 3# 的帖子

如果是程序自带的话,一般只要在后台开启就可以了。
也就不存在什么选择将.htaccess放在某处的说法了,默认放置的位置就可以了。

你使用的是Linux主机吗?
RAKSmart

twm123

发表于 2011-3-8 18:48:29 | 显示全部楼层

是的 从Win 换成Linux的
00.jpg

微微百科

发表于 2011-3-8 18:52:44 | 显示全部楼层

回复 5# 的帖子

Linux可以支持.htaccess的。

nginx_rewrite.htaccess和.htaccess

这二个文件都是默认程序自带的吗?你没有修改过?

twm123

发表于 2011-3-8 18:53:47 | 显示全部楼层

我没动过的 可以帮忙弄呀 吗

微微百科

发表于 2011-3-8 19:04:18 | 显示全部楼层

回复 7# 的帖子

要不你再重新上传一次这个程序包,然后再重新安装一次,注意安装后不要对文件做修改操作,然后再到后台开启伪静态功能,看个行。

twm123

发表于 2011-3-8 19:08:42 | 显示全部楼层

没金币了 给你发短消息都不能
程序在这个页面 http://www.le234.com/my/phpcodesource.html
你可以去看看  只要上传就能运行 不要安装的  
难道上传时要选择 上传模式吗 还是文件夹人设置权限的 我都默认的
给你帐号密码可以帮我弄下吗

微微百科

发表于 2011-3-8 19:14:08 | 显示全部楼层

程序在这个页面 http://www.le234.com/my/phpcodesource.html


这个是你的网站吗?你使用程序是那个版本的?
您需要登录后才可以回帖 登录 | 注册

本版积分规则