从HTTPD/Apache中的请求中删除URI

从HTTPD/Apache中的请求中删除URI,apache,http,url-rewriting,Apache,Http,Url Rewriting,使用Apache2.4(Windows) 如果我在浏览器中输入地址为http://example.com:8080/blahblah/或http://example.com:8080/转到相同的DocumentRoot。换句话说,我希望从路径中删除URI或子文件夹 这就是我到目前为止所做的: Listen 8080 ... <VirtualHost *:8080> ServerName example.com DocumentRoot ${SRVROOT}/htdoc

使用Apache2.4(Windows)

如果我在浏览器中输入地址为
http://example.com:8080/blahblah/
http://example.com:8080/
转到相同的
DocumentRoot
。换句话说,我希望从路径中删除URI或子文件夹

这就是我到目前为止所做的:

Listen 8080
...
<VirtualHost *:8080>
    ServerName example.com
    DocumentRoot ${SRVROOT}/htdocs/example

    Alias "/(.+)" %{DOCUMENT_ROOT}
</VirtualHost>
听8080
...
ServerName example.com
DocumentRoot${SRVROOT}/htdocs/example
别名“/(.+)”%{DOCUMENT_ROOT}
我还尝试了以下方法:

Listen 8080
...
<VirtualHost *:8080>
    ServerName example.com
    DocumentRoot ${SRVROOT}/htdocs/example

    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/[.]+    <--- finds at least one character
    RewriteRule ^(.*)$ http://example.com:8080/ [L]
</VirtualHost>
听8080
...
ServerName example.com
DocumentRoot${SRVROOT}/htdocs/example
重新启动发动机
重写条件%{REQUEST_URI}^/[.]+