阿帕奇虚拟主机
我已经被这个问题困扰了很长时间了:-(,基本上我的“别名”标签在我的 c:\xampp\apache\conf\virtual-hosts.conf 中不起作用。Url http://raghu.tkiportal 工作正常,但 http:// raghu.tkiportal/simplesaml 不存在。别名标记的目录结构存在于我的本地主机中(我检查过)
这是我对许多站点之一的设置
NameVirtualHost *:80
<VirtualHost *:80>
AcceptPathInfo On
ServerName raghu.tkiportal
Alias /simplesaml C:/xampp/htdocs/tki_portal4.2/extension/feide/lib/simplesaml/www
DocumentRoot C:/xampp/htdocs/tki_portal4.2
<Directory C:/xampp/htdocs/tki_portal4.2>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
LogLevel debug
ErrorLog C:/xampp/apache/logs/raghu_tki_portal_error.log
CustomLog C:/xampp/apache/logs/raghu_tki_portal_access.log combined
ServerSignature On
RewriteEngine On
RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* /index_image_tki_portal.php [L]
RewriteRule !(^/design|^/var|.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf|mov|html|xml|xsl|htc)$ /index.php
</VirtualHost>
你们看到我的设置有任何错误吗? 你们
非常感谢任何帮助...谢谢
RD
i have been struck on this for a looooong time now :-(, Basically my "Alias" tag is not working in my c:\xampp\apache\conf\virtual-hosts.conf. Url http://raghu.tkiportal works OK but http://raghu.tkiportal/simplesaml DOES NOT. The directory structure for Alias tag exists in my localhost (i checked)
This is my setting for one of many sites
NameVirtualHost *:80
<VirtualHost *:80>
AcceptPathInfo On
ServerName raghu.tkiportal
Alias /simplesaml C:/xampp/htdocs/tki_portal4.2/extension/feide/lib/simplesaml/www
DocumentRoot C:/xampp/htdocs/tki_portal4.2
<Directory C:/xampp/htdocs/tki_portal4.2>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
LogLevel debug
ErrorLog C:/xampp/apache/logs/raghu_tki_portal_error.log
CustomLog C:/xampp/apache/logs/raghu_tki_portal_access.log combined
ServerSignature On
RewriteEngine On
RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* /index_image_tki_portal.php [L]
RewriteRule !(^/design|^/var|.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf|mov|html|xml|xsl|htc)$ /index.php
</VirtualHost>
Do you guys see any fault with my settings? The same setting works on linux box.
Any help would be very much appreciated...Thanks guys
RD
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个(因为 Windows 在路径名中使用 \ 而不是 /):
我以前没有在 Windows 上运行过 Apache,但认为路径中的 / 是问题所在。
Try this (as Windows uses \ instead of / in path names):
I haven't run Apache on Windows before but think that the / in the paths are the issue.
是 http://raghu.tkiportal/extension/feide/lib/simplesaml/www 工作?
然后读取您的配置,恐怕最后的重写规则优先于您的别名(或在之后应用)。因此,您的 /simplesaml/index.[html.php] 被重定向到 /index.php
重写规则包含例外,请尝试在例外列表中添加 simplesaml:
要调试此内容,您可以激活 RewriteLogLevel 9 和重写日志 /absolute/path /to/debug.log 并检查 /simplesaml 上的调用是否已被 mod_rewrite 重写
is http://raghu.tkiportal/extension/feide/lib/simplesaml/www working?
Then reading your configuration I'm afraid the last rewrite rule takes precedence on your alias (or applies just after). So your /simplesaml/index.[html.php] is redirected on /index.php
The rewrite rule contains exceptions, try to add simplesaml in the exceptions listing:
To debug this you could activate RewriteLogLevel 9 and a Rewrite Log /absolute/path/to/debug.log and check that you calls on /simplesaml are rewritten by mod_rewrite
[已解决] 我必须包含一个 RewriteCond...说如果它是 simplesaml 那么不应用最后的重写规则。感谢 regilero 关于 RewriteRule 的提示。
[SOLVED] I had to include a RewriteCond...saying if its simplesaml then don't apply the the last rewrite rule. thanks for the tip regilero regarding the RewriteRule.