Home
Sign Up
Sign In
V2EX
›
问与答
这个htaccess 要怎样写才能实现?
momou
·
Mar 12, 2013
· 3407 views
This topic created in 4995 days ago, the information mentioned may be changed or developed.
已经有一个网站abc.com,现在访问网站程序会默认转到abc.com/forum/default.htm
现在的问题是要怎样才能实现访问网站得到的链接是:abc.com/default.htm ,而不影响现在的后台管理功能如:abc.com/manage/
望各位不吝赐教。。。
com
abc
htm
6 replies
•
1970-01-01 08:00:00 +08:00
revlis7
Mar 12, 2013
1
RewriteEngine on
RewriteCond $1 !^(manage)
RewriteRule ^(.*)$ forum/$1 [L]
momou
OP
Mar 12, 2013
2
@
revlis7
这样写直接导致服务器出错,我想可能是原来的程序写死直接访问/forum/default.htm的原因吧
revlis7
Mar 12, 2013
3
@
momou
Sorry,没有测过就发出来了,这个是我写的有问题,这样试试:
RewriteEngine on
RewriteCond $1 !^(manage|forum)
RewriteRule ^(.*)$ forum/$1 [L]
momou
OP
Mar 12, 2013
4
@
revlis7
这样可以访问,但后台程序还是会报错,排除所有其它目录都不行,所以问题应该还是在程序上?
还是有一个办法只把/forum/目录的文件重写?
revlis7
Mar 12, 2013
5
@
momou
那要看具体报什么错了,也许后台页面中不仅仅包含manage目录下的内容,或者代码里有其他冲突。
momou
OP
Mar 12, 2013
6
@
revlis7
终于找到问题了。。。
RewriteCond $1 !^(index\.php|manage|forum)
这样就行了。。。
非常感谢你!
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
1904 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 27ms ·
UTC 00:16
·
PVG 08:16
·
LAX 16:16
·
JFK 19:16
♥ Do have faith in what you're doing.
❯