Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
.htaccess
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- .htaccess
.htaccess
23-01-2008 12:33 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hi
Have htaccess to password protect a sub directory. What i want to do is set it up so that if someone clicks cancel on password dialog it redirects to a file in higher directory which I've called main_dir in below example. This is my htaccess file
AuthName "members"
AuthType Basic
AuthUserFile /files/home2/user/main_dir/protected/.htpasswd
require valid-user
ErrorDocument 401 ../index.html
I get the user/password dialog OK and can login but all I get for the 401 error document (if cancel) is a page that prints ../index.html
Any pointers as to where I'm going wrong?
Have htaccess to password protect a sub directory. What i want to do is set it up so that if someone clicks cancel on password dialog it redirects to a file in higher directory which I've called main_dir in below example. This is my htaccess file
AuthName "members"
AuthType Basic
AuthUserFile /files/home2/user/main_dir/protected/.htpasswd
require valid-user
ErrorDocument 401 ../index.html
I get the user/password dialog OK and can login but all I get for the 401 error document (if cancel) is a page that prints ../index.html
Any pointers as to where I'm going wrong?
Message 1 of 6
(3,937 Views)
5 REPLIES 5
Re: .htaccess
23-01-2008 12:55 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Intersting that if I replace the ../index.html with html it works
i.e. ErrorDocument 401 "<a href='../index.html'>Click</a>"
i.e. ErrorDocument 401 "<a href='../index.html'>Click</a>"
Message 2 of 6
(765 Views)
Re: .htaccess
23-01-2008 9:25 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The ErrorDocument directoive does not accept relative paths.
If the file provided does not conform to URL standards 9ie, not a full external URL, or not a path starting /), it will treat the item as text.
So if for example your protected file is in http://ccgi.username.plus.com/main_dir/protected/
And you wanted the file you provided, you would supply
ErrorDocument 401 /main_dir/index.html
If the file provided does not conform to URL standards 9ie, not a full external URL, or not a path starting /), it will treat the item as text.
So if for example your protected file is in http://ccgi.username.plus.com/main_dir/protected/
And you wanted the file you provided, you would supply
ErrorDocument 401 /main_dir/index.html
Message 3 of 6
(765 Views)
Re: .htaccess
23-01-2008 2:00 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thought I'd tried that. But yes that works thanks. The interesting thing is when the error document loads it doesn't load the external css file so it just shows page without CSS. Not a problem but wondered why?
Message 4 of 6
(765 Views)
Re: .htaccess
23-01-2008 10:59 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Where is the CSS file in relation to the error document file?
Are you using a relative (i.e. ../styles/style.css) path to it or an absolute (/styles/style.css) path to it. Try either method to see if it is loaded.
Are you using a relative (i.e. ../styles/style.css) path to it or an absolute (/styles/style.css) path to it. Try either method to see if it is loaded.
Message 5 of 6
(765 Views)
Re: .htaccess
23-01-2008 11:59 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The problem is I think its looking for CSS that is in protected directory eventhough loading page from above. No worries it's not a problem, I've done things slightly different which is improved.
Message 6 of 6
(765 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page