C5 site launched but causing issues

Permalink
Hi All,

I just launched a C5 site from the root directory. The site was an HTML site prior and here are the issues I'm seeing. Link to the ocCommerce admin area is not working. I get the C5 error page instead. The osCommerce store is located in a subfolder of the main site (SSL - https), and is working fine. Can log into it and all that. The admin part (located in a folder below the store's main folder) we cannot log into. Any hints? The .htaccess file for the admin is in the domain/store/admin level. The file contains the auth protection:
##### OSCOMMERCE ADMIN PROTECTION - BEGIN #####
AuthType Basic
AuthName "osCommerce Online Merchant Administration Tool"
AuthUserFile /folder/account/public/store/admin/.htpasswd_oscommerce
Require valid-user
##### OSCOMMERCE ADMIN PROTECTION - END #####
When I add the above code to the root .htaccess file the C5 site becomes inaccessible with a login prompt in its place. When I put the code in the public/store/ .htaccess file, the store itself becomes inaccessible. Is there a way around this? We can't have this site without the store or the admin to the store. We just launched C5 today but the store has been there for years - would really appreciate help.

I have one other issue with a page not found but I'll have to post about that later. It's not as detrimental as the store admin issue.

Thanks in advance,
Hope

HopeL
 
WebcentricLtd replied on at Permalink Reply
does it work ok if you have your password protection in a .htaccess in site/store/admin/ (and nowhere else)
with pretty URLs turned off in C5?
WebcentricLtd replied on at Permalink Reply
conversely if you have no password protection applied at all are you able to access the OSC admin login page?
HopeL replied on at Permalink Reply
HopeL
Sure that works but then the entire C5 site is disabled. As far as removing that protection, yes, I get a log in but we're no longer protected like we were. What is also strange is when I try to go to the https admin URL nothing displays correctly - like the .css file is missing.
WebcentricLtd replied on at Permalink Best Answer Reply
ok - not sure why your c5 site would not be working unless you:
just removed the rewrite rules from .htaccess and didn't turn pretty urls off in the C5 admin area

The problem is down to the rewrite rules In your root level .htaccess file for the c5 pretty URLs (unless you also have other redirects in there as well).

What happens if you add the following to the top of your root level .htaccess file:

ErrorDocument 401 default

And have the C5 rewrite rules as before and your password protection .htaccess under

/site/store/admin/
?
HopeL replied on at Permalink Reply
HopeL
> ok - not sure why your c5 site would not be working unless you:
> just removed the rewrite rules from .htaccess and didn't turn pretty urls off in the C5 admin

You are correct! I forgot to turn off pretty urls in the admin. Sorry, it's been quite a stressful day.

I did the following:
-add ErrorDocument 401 default to the top of my root .htaccess (pretty url code also in)
-added the auth code back to .htaccesss in /site/store/admin/
I get the regular log in, not the double log in which we had before. However, it looks like the CSS file is no longer missing.
WebcentricLtd replied on at Permalink Reply
so,
as a recap
c5 is working ok including pretty URLs
your store is working ok in /site/store/
your store admin area is working ok in /site/store/admin/

the only issue you have now is that you do not receive the pop-up authentication box when you try to access /site/store/admin but go straight to the OSC login.

If all the above is correct the only thing I can suggest is:

if you are in the admin directory press ctrl+f5 to force-refresh your browser.
If this does not do anything different then I'd double-check that the .htaccess is definitely in
site/store/admin
and that it definitely contains the lines in it as before with the path the the passwd file etc
HopeL replied on at Permalink Reply
HopeL
AndyJ, you are a saint - such a great help!

Yes, everything is working almost as it was before. The only difference is when I log out of the OSC admin it brings me to the regular login page not the double prompt. Frankly, I don't recall that before - I thought it always gave me the double prompt. I suspect it has something to do with the fact that I've already logged in (as far as the initial auth is concerned) and it's just the OSC admin that I need to sign back into. Not sure but I'm guessing it's still as secure as it was before the C5 launch.

I really appreciate the help. I couldn't have done it myself - you patiently stepped me through the process of troubleshooting this and I'm forever grateful!

Hope
WebcentricLtd replied on at Permalink Reply
no worries - glad it is all working ok. Ideally you should move your site/store/admin to a different directory (ideally using a randomized string or something like that for the directory name) and if you can - put the .htpasswd file outside of the webroot - but that sounds like a job for another day :)
HopeL replied on at Permalink Reply
HopeL
Thanks. It's not actually in a folder called "admin" but it is in a similar and probably default folder name from the set up. I'll pass the note on to the OSC guy. I don't do much with that other than add products. It's been such a PITA system but it has everything the client requires or it can be programmed to do so.

Thanks again - you made my day!