English 中文(简体)
• 如何把所有交通都改成单子
原标题:How to make my htaccess file rewrite all traffic to cgi-bin
  • 时间:2012-01-14 00:09:36
  •  标签:
  • .htaccess

我想把我的单程文件将所有交通改用,但去向单人/人、人/人以及人/人。

RewriteEngine on
RewriteCond %{REQUEST_URI} !^images/.*$
RewriteCond %{REQUEST_URI} !^css/.*$
RewriteCond %{REQUEST_URI} !^javascript/.*$
RewriteCond %{REQUEST_URI} !^cgi-bin/.*$
RewriteRule (.*) /cgi-bin/$1 [L]

I want a request for: example.com/index to retrieve example.com/cgi-bin/index
but I also want a request for: example.com/images/foo.png to retrieve example.com/images/foo.png

我的档案有什么错误? 我保留了这一错误:Request over the limit of 10 Internal redirects due to likely formation mis.

最佳回答

您没有在您的<代码>上填写<<><>>>>,但不必在www.htaccess上使用Rewrite Rule,这确实会造成混乱。

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/images/ [NC]
RewriteCond %{REQUEST_URI} !^/css/ [NC]
RewriteCond %{REQUEST_URI} !^/javascript/ [NC]
RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC]
RewriteRule (.*) /cgi-bin/$1 [L]

You also don t need the .*$ so I removed them to make it more efficient.

问题回答

暂无回答




相关问题
Ignore symlinks in clean URL s in .htaccess

Example URL: example.com/user /user is both a symlinked directory and a valid URL to content on my site. I user Horde Routes to request the content and all requests to the site go through index.php. ...

.htaccess File Options -Indexes on Subdirectories

I have the following .htaccess line, simple no indexes on root. Options -Indexes What do we add so it propagates to any sub directory instead of having to create one file for each? One .htaccess on ...

Mod Rewrite ignoring -d

After a day or two, I am still fighting with Mod Rewrite. It seems that 60% of my development time is spent battling the server. My current URL structure is such that all http://example.com/xyz and ...

ErrorDocument 404 Not Sending Referrer Information: PHP

I m using a standard htaccess ErrorDocument 404 to redirect users to a new page. In order to customize the 404, I need to know their referrer information (from the page they Tried to visit). $...

Find all htaccess files on server [closed]

I m looking for a Linux command to go through all the directories on my server and find all .htaccess files. The output would be a list of all those files with full path, creation/modification date ...

301 Redirect Help with Dynamic URL s and Multiple Id s

I just did a redesign for www.wildchildclothes.com which has a new URL structure. The old site ran on Zen Cart and had a bad URL structure. Here are some examples of what I want to redirect from: OLD:...

热门标签