早上好, 我正在尝试为我的网站内的所有css文件请求创buildRewriteRule到css / filename.css。 该过程是我的网站商店内的所有css文件只在mydomain.com/css/filename.css,但有一些页面,我写了规则和直接浏览器通过友好的urlmydomain.com/services/index.html,然后请求css文件无法find。 任何人有经验请帮助。 问候,
所以在Wordpress中有一个文件,wp-content / blogs.php,通过Wordpress上传文件。 WP .htaccess中有一个重写规则,将www.blah.com/files/11/01/filename.mp3格式的URL重写为格式为www.blah.com/…/wp-content/blogs的URL .PHP?文件= FILENAME.MP3。 RewriteRule ^(./ )?files /(。)wp-content / blogs.php?file = $ 2 [L] 所以这里是问题:我们已经开启了PHP文件的gzip。 我需要根据查询参数“file”在blogs.php上closures它。 (不仅仅是因为你不应该gzip二进制文件,而是因为gzip压缩.mp3在Firefox和Mac上为Quicktime插件创build了严重的问题。) 但是以下SetEnvIf不适用于通过blogs.php提供的任何文件 – Request_URI总是以.php结尾 SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary 以下方法通过closures通过blogs.php提供的所有文件的gzip来解决问题: <Location /michael/blah/wp-content/blogs.php> SetEnv no-gzip </Location> 但这不是一个好的解决scheme,因为我想通过blogs.php提供的非二进制文件进行压缩。 所以我真正想要的是获取原始 URI的方式,而不是重写的URI,因为原始URI确实以.mp3结尾。 或者,我需要在重写的URI(file = filename.mp3)末尾访问查询参数。 比如,像这样的东西就可以工作,如果它存在的话,那不是: SetEnvIfNoCase Original_Request_URI \.mp3$ no-gzip dont-vary 看起来有一个variablesTHE_REQUEST可以在一个RewriteRule中工作,但对SetEnv来说似乎不可用。 有任何想法吗? 谢谢! 让我知道如果我违反任何规则,这是我第一次在这里发表。
我有一个网站在www.domain.com运行。 客户现在希望网站似乎在www.otherdomain.com/whatson/brand/下运行 由于该网站是umbraco它不会在子文件夹下运行。 我想使用ISAPI重写代理请求www.domain.com使用以下规则在.htaccess在www.otherdomain.com/whatson/brand/ RewriteRule ^(.*)$ http://www.domain.com/$1 [P,L] 但是,当我应用这个我得到一个丑陋的500内部服务器错误。 事件日志中没有任何内容。 所以我打开ISAPI日志logging,可以看到以下内容 111.111.111.111 111.111.111.111 Tue, 12-Jan-2010 13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (2) init rewrite engine with requested uri /whatson/brand/home.aspx 然后testing服务器上的所有其他重写规则。 那这个 111.111.111.111 111.111.111.111 Tue, 12-Jan-2010 13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (1) Htaccess process request w:\websites\otherdomain.com\docs2\whatson\brand\.htaccess 111.111.111.111 111.111.111.111 Tue, 12-Jan-2010 13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (3) applying pattern '^(.*)$' to uri 'home.aspx' 111.111.111.111 […]
我正尝试通过IIS7(Windows 7)上的“使用URL重写模块 ”来重写URL。 url: http://localhost/AIM/group-discussion/videos.aspx?id = 4&title =部分标题 重写URL: http:// localhost / AIM / group-discussion / videos / 4 / some-title 重写规则: <rewrite> <rules> <rule name="RewriteUserFriendlyURL1" stopProcessing="true"> <match url="^AIM/group-discussion/videos/([^/]+)/([^/]+)/?$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="AIM/group-discussion/videos.aspx?id={R:1}&title={R:2}" /> </rule> </rules> </rewrite> 访问重写URL( http:// localhost / AIM / […]
我在位于某个子域根目录的.htaccess文件中有以下代码,例如http://demo.example.com : RewriteEngine on RewriteRule ^$ /admin/index.php?q=user/nazgulled [L] 当有人访问http://demo.example.com时 ,他们将被redirect到上面的URL。 这是一个HTML页面。 但是这个HTML页面正在使用像图像,CSS代码和JavaScript代码的相对地址。 他们不工作,因为它无法find当前目录(子域根)中的文件。 他们位于“pipe理员”文件夹。 我怎样才能使这项工作只改变.htaccess文件?
在提出问题之前让我告诉你一些假设这里有5个文件在我的web服务器上index.php config.php read.php write.php .htaccess 我在.htaccess中写了下面的URL重写规则 在RewriteRule上RewriteEngine ^(\ w +)$ read.php?id = $ 1 现在,当我键入domain.com/xyz它从read.php?id = xyz获取数据那很好:) 但是,当我键入domain.com/index它从index.php获取数据,或者当我键入domain.com/write或domain.com/config或domain.com/read它从write.php,config.php和读取数据.php分别 我希望数据从read.php?id = index或read.php?id = config或read.php?id = read或read.php?id = write 任何人都可以帮助我呢? 对不起,我英文很差
所以我有两个应用程序我想运行在服务器上。 一个应用程序,我想成为“默认”的应用程序 – 也就是说,所有的URL应该默认发送这个应用程序, 除了一个特定的path,让我们调用它/foo : http://mydomain.com/ -> app1 http://mydomain.com/apples -> app1 http://mydomain.com/foo -> app2 我的两个机架应用程序安装如下所示: /var /www /apps /app1 app.rb config.ru /public /app2 app.rb config.ru /public app1 -> apps/app1/public app2 -> apps/app2/public ( app1和app2是符号链接到他们各自的应用程序的公共目录)。 这是这里描述的子URI的Passenger设置: http : //www.modrails.com/documentation/Users%20guide%20Nginx.html#deploying_rack_to_sub_uri 用下面的configuration我有/foo去app2: server { listen 80; server_name mydomain.com; root /var/www; passenger_enabled on; passenger_base_uri /app1; passenger_base_uri /app2; location […]
我在修改URL时遇到了麻烦。 我的规则工作正常,但他们编码GET参数。 / myurl / search?text = accèsbecome / myurl / search?text = acc%25C3%25A8s 我的search引擎不能使用这个参数,我不能在POST方法中传递它们。 我怎样才能摆脱这种编码? 这是我的.htaccess的内容: RewriteEngine On RewriteRule ^ var /.* – [L] RewriteRule ^ design /.* – [L] RewriteRule ^ share / icons /.* – [L] RewriteRule ^ sitemaps /.* – [L] RewriteRule ^ kernel /.* – [L] RewriteRule ^ extension /.* […]
我正在尝试从nginx.conf中的确切文件夹redirect 给定URL:domain.com/path1/path2/path3 redirect到:sub.domain.com/path1/path2/path3 以下是我到目前为止: location ~* ^/path1[\/?]$ { rewrite ^/(.*) http:sub.domain.com/$1 break; } 我曾与之合作过 location /path1 { rewrite ^/(.*) http:sub.domain.com/$1 break; } 这个问题是它也redirect页面像domain.com/path1moretext/sotherotherpath到sub.domain.com/path1moretext/sotherotherpath 这不是我想要的。 (必须在上面的href代码中取出“//”,因为这是我的第一篇文章,对不起)。
我已经把我所有的文件从我的网站的根目录移动到一个子文件夹,我想做一个Apacheredirect指向这些文件,而不会影响我的网站中的其他子文件夹。 例如 /index.html – redirect到 – > /subfolder1/index.html /file1.html – redirect到 – > /subfolder1/index.html /subfolder2/index.html – 没有redirect 任何人都可以帮我用我需要写的redirect规则。 谢谢,