Page 1 of 1

annoying configuration

Posted: Wed Jul 25, 2007 8:40 pm
by m2babaey
Hi
I'm working on a site that is badly annoying me.
when I go to http://www.hotique.com/operator it asks for password. I went to cpanel, password protected directories. added myself as a user and used it details to login. but it didn't work ( going on asking password)
then I unchecked the "Directory requires a password to access via the web"
but it didn't work either
that's not all. When I want to enter some diretories, it redirects me to error404.html like http://www.hotique.com/partner
even I created a test folder http://www.hotique.com/testo and placed a test page (index.htm) there but it redirects me to error404.html too
tried clearing cache
why are they happening?

Posted: Thu Jul 26, 2007 8:32 am
by miro_igov
Have you heard about .htaccess? As I remember from your posts you are working on osCommerce (is that true?), and if you use mod_rewrite it is very possible to redirect to 404 when you try to access dirs you create.

Also the admin back end in osC is password protected by.htaccess which is not controlled from cpanel's password protected dirs :)

Posted: Thu Jul 26, 2007 8:59 am
by m2babaey
many thanks miro_igov
I read some tutorials about mod-rewrite yesterday. so I'm not waaay away from understanding htaccesses.
but cannot find what is subjected to my problems in the htaccess right now.
Can you help me which parts should be modified?
this is my htaccess: (which syntax to use?)

Code: Select all

Options -Indexes
DirectoryIndex index.html

php_value session.use_trans_sid "Off"
php_value display_errors "On"

AddType application/x-httpd-php .html

# rewrite urls
Options +FollowSymLinks
RewriteEngine on


RewriteRule  ^top-hotels-([0-9]+)-(.*)\.html$    view_details.html?apartments_id=$1 [L]



# all-spa-hotels.html
RewriteRule  ^all-([a-z\-]+)-hotels\.html$    all_hotels.html?type_name=$1 [L]
# spa-directory-London.html
RewriteRule  ^([a-z]+)-directory-(.*)\.html$    regions.html?type_name=$1&regions_name=$2 [L]
# spa-hotels-London.html
#RewriteRule  ^([a-z]+)-hotels-(.*)\.html$    listing.html?type_name=$1&cities_name=$2 [L]

RewriteRule  ^(city|beach|country|ski|spa)-hotels-(.*)\.html$    listing.html?type_name=$1&cities_name=$2 [L]

RewriteRule  ^city/(.*)$    cities-pages.php?cities_name=$1 [L]
RewriteRule  ^destination/(.*)\.html$    destinations-pages.php?countries_name=$1 [L]

RewriteRule  ^hotel-([0-9]+)-(.*)\.html$    view_details.html?apartments_id=$1 [L]
RewriteRule  ^hotels-directory-(.*)\.html$    regions.html?regions_name=$1 [L]
RewriteRule  ^hotels-(.*)\.html$    listing.html?cities_name=$1 [L]
RewriteRule  ^villas-(.*)\.html$    listing.html?cities_name=$1&cID=2 [L]

RewriteRule  ^top-cities-(.*)\.html$    listing.html?cities_name=$1 [L]
RewriteRule  ^top-destinations-villas-(.*)\.html$    listing.html?countries_name=$1&cID=2 [L]

RewriteRule  ^top-destinations-(.*)\.html$    listing.html?countries_name=$1 [L]

RewriteRule  ^top-villa-cities-(.*)\.html$    listing.html?cID=2&cities_name=$1 [L]

RewriteRule  ^pages/(.*)$    pages.php?pages_name=$1 [L]
RewriteRule  ^photos-([0-9]+)-(.*)\.html$    photos.html?apartments_id=$1 [L] 

RewriteRule  ^reviews-([0-9]+)-(.*)\.html$    reviews.html?apartments_id=$1 [L]
RewriteRule  ^villa-([0-9]+)-(.*)\.html$    view_details.html?apartments_id=$1 [L]

RewriteRule  ^viewhotels-([0-9]+)-(.*)-([0-9]+)\.html$ view_details.html?apartments_id=$1&at=$3 [L]

RewriteRule  ^news/news-([0-9]+)-(.*)\.html$    news/index.html?nID=$1&mode=read [L]

php_flag register_globals on 
php_flag display_errors on      

Posted: Thu Jul 26, 2007 9:02 am
by m2babaey
also (as i remember) there was a .htaccess and .htpasswd in the operator folder (in addition to the htaccess in the www folder) and i removed them.
the problem still exists

Posted: Thu Jul 26, 2007 9:05 am
by miro_igov
In order to get access to the admin you can temporary remove or rename the .htaccess file located in the admin/ dir.

for the 404 redirect i don't see any reason but you can try to comment out the rewrite rules and see if it comes from them.

Posted: Thu Jul 26, 2007 9:20 am
by m2babaey
I removed aall .htaccess and .htpasswd files i saw but it's going on sending error. 8O
I don't knw what is osC clearly but that is a hotel booking site (hotique.com)

:( :(

Posted: Thu Jul 26, 2007 10:40 am
by miro_igov
I'm sure you do something wrong. You can hire someone to help you.

Posted: Thu Jul 26, 2007 11:58 am
by m2babaey
miro_igov wrote:I'm sure you do something wrong. You can hire someone to help you.
please have a look at this thread

Posted: Thu Jul 26, 2007 3:50 pm
by miro_igov
I meant the opposite, you need to hire someone and pay him to fix your issue. If you are not doing well with the money i can offer you my lowest rate $20/hour.