[Solved] Problem with pretty URL and password protection

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
Edi
Forum Members
Forum Members
Posts: 21
Joined: Wed Sep 12, 2007 9:37 am

[Solved] Problem with pretty URL and password protection

Post by Edi »

I have installed my CMS with pretty URL. The code in .htaccess is:

Code: Select all

# Redirection
Redirect permanent /index.html http:/cms/index.php

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On
RewriteBase /cms/

#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]


This works without any problems. And I can access other directories. But when I password protect a directory I cannot access it anymore (error 404, requested URL was not found on this server).

Any idea what goes wrong?

Edi
Last edited by Edi on Wed Nov 07, 2007 10:19 pm, edited 1 time in total.
Pierre M.

Re: Problem with pretty URL and password protection

Post by Pierre M. »

Hello,

"password protect" -> you mean http basic/digest auth ?
If so, are your protection rules before your rewrite rules ?

What are in your http logS and rewritelog ?

Is the folder your want to protect under /cms/ or elsewhere ?

Pierre M.
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: Problem with pretty URL and password protection

Post by kermit »

sounds like the same problem I described here:

http://forum.cmsmadesimple.org/index.ph ... 938.0.html

turned out to be nothing to do with cmsms or mod_rewrite; but with the lack of having custom error documents in the domain root.. the 404 was caused by a missing one; not a 'missing' requested url.

add them and see what happens..

for reference; i added all the usual ones; 400.shtml, 401.shtml, 403.shtml, 404.shtml, and 500.shtml - cpanel (the cp on that particular server) has a facility to add/edit custom error documents -- other cp's (like hsphere) do as well.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Edi
Forum Members
Forum Members
Posts: 21
Joined: Wed Sep 12, 2007 9:37 am

Re: Problem with pretty URL and password protection

Post by Edi »

Thank you all! Reading your posts I realized what I have made wrong...

The .htaccess file was placed in the root directory. Now I split it in two files.

This file is placed in the root directory:

Code: Select all

# Redirection
Redirect permanent /index.html http:/cms/index.php
This one in the directory /cms:

Code: Select all

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On
RewriteBase /cms/

#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
And it works!
Locked

Return to “[locked] Installation, Setup and Upgrade”