2

I have one sudomain: http://demo.ikeepstudying.com/.
Under this, I have one client folder: intowealth.

I want to add two files:

.htaccess file

AuthType Basic  
AuthName "Administration"  
AuthUserFile /demo/intowealth/.htpasswd 
require valid-user

RewriteEngine On

RewriteRule ^attend/(.+)/([0-9]+)(.htm)*$   /intowealth/index.html?type=$1&event_id=$2 [L]

and .htpasswd file, that is not working for URL rewrite, the error is :

enter image description here

If I remove

AuthType Basic  
AuthName "Administration"  
AuthUserFile /demo/intowealth/.htpasswd 
require valid-user

the URL rewrite will be working well.

But how can I keep both of them in same .htaccess file?

4

1 回答 1

0

你能试一下吗:

AuthType Basic  
AuthName "Administration"  
AuthUserFile {$_SERVER['DOCUMENT_ROOT']}/demo/intowealth/.htpasswd 
require valid-user

RewriteEngine On
RewriteBase /intowealth/

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^attend/([^/]+)/([0-9]+)(\.htm)?$ index.html?type=$1&event_id=$2 [L]
于 2013-10-07T21:01:47.527 回答