dav*_*t-g 5 apache url mod-rewrite alias rewrite
如果这太长,我会提前道歉.我认为更多的细节比更少的更好,并希望我不是可怕的漫无边际:-)
我在我的笔记本电脑上使用WAMP用于本地开发,我有各种c:/wamp/alias/*
文件,每个文件都指向一个项目工作目录.我有一些很棒的mod_rewrite帮助并得到了
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*\/)?ih(\/.*)?$ $1index.php$2 [L,QSA]
Run Code Online (Sandbox Code Playgroud)
合作,改变localhost/.../ih/sub/dir
以localhost/.../index.php/sub/dir
针对既搜索引擎友好的和短网址.[我还没有在这样做的督促,但我怀疑这会很好的工作.然而,把一切在一起,我不得不改变我的文档根c:/wamp/www/
来c:/
,这我真的不想只是做我的Apache被黑客攻击,否则因为它是一个kludge.
我的测试别名文件看起来像
Alias /testme "c:/var/tmp/wamp-testme/"
<Directory "c:/var/tmp/wamp-testme/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*\/)?ih(\/.*)?$ $1index.php$2 [L,QSA]
</Directory>
Run Code Online (Sandbox Code Playgroud)
我尝试加载时得到的错误http://localhost/testme/rewrites/ih/sub/path
是
[Thu Jun 30 06:46:13 2011] [error] [client 127.0.0.1]
File does not exist: C:/wamp/www/var
Run Code Online (Sandbox Code Playgroud)
与匹配
Not Found
The requested URL /var/tmp/wamp-testme/rewrites/index.php/sub/path
was not found on this server.
Run Code Online (Sandbox Code Playgroud)
在浏览器中.果然,我的c:/wamp/alias/flying.conf
文件中指向该c:/data/flying/
目录的相同配置会引发File does not exist: C:/wamp/www/data
错误日志文件,依此类推.
Sooooo ...如何在我的机器根目录下没有我的doc root的情况下,有一个超越别名的重写规则?
归档时间: |
|
查看次数: |
4089 次 |
最近记录: |