annoying configuration

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

annoying configuration

Post 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?
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post 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 :)
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post 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      
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post 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
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post 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.
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post 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)

:( :(
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post by miro_igov »

I'm sure you do something wrong. You can hire someone to help you.
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post 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
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post 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.
Post Reply