Jump to content

help with .htaccess (localhost work but online worst)


Go to solution Solved by Ch0cu3r,

Recommended Posts

 I have create a working site at localhost but when I upload it to webhost, it's not working, all link broken.

 

This is the site.

 

this is the directory :

288pq1u.png

 

The index.php content is :

<?php
  header('location:home.html'); 
?>

and the .htaccess content is :

RewriteEngine on

RewriteRule ^home.html$ main/home.php?main=home [L]
RewriteRule ^penyakit.html$ main/home.php?main=penyakit [L]
RewriteRule ^review-(.*)\.html$ main/home.php?main=detilgejala&id=$1 [L]
RewriteRule ^solusi.html$ main/home.php?main=solusi [L]
RewriteRule ^proses$ main/home.php?main=prosessolusi [L]
RewriteRule ^bukutamu.html$ main/home.php?main=bukutamu [L]
RewriteRule ^send-contact$ main/main_bukutamu/proses_bukutamu.php [L]
RewriteRule ^about.html$ main/home.php?main=about [L]
RewriteRule ^ensiklopedia.html$ main/home.php?main=ensiklopedia [L]

Options All -indexes

This config work in localhost. Thanks for your attention and respond, it help me so much  and sorry for the topic's title can't edited it. :)

Edited by havide

Are you sure your website uses an Apache http server? Run phpinfo() to find out.

 

If it is an Apache server have you made sure the .htaccess is being read? Best way to test this is to add random gibberish into the file. If the .htaccess file is being read then a 500 Internal Server error will be issued.

Are you sure your website uses an Apache http server? Run phpinfo() to find out.

 

If it is an Apache server have you made sure the .htaccess is being read? Best way to test this is to add random gibberish into the file. If the .htaccess file is being read then a 500 Internal Server error will be issued.

 

this is the result, apache 2.0 handler. is't right?

I think the .htaccess file worked and readed because if I put in my .htaccess code :

DirectoryIndex main/home.php 

at first line, it work and my homepage showed, but not the other page because the "RewriteRule".

I think its the apache server version or another thing in 000webhost not giving permission or not compatible to "RewriteRule" because when I change to hostinger with this phpinfo, all my .htaccess work here. ;D

Any Suggestion? btw, thanks Ch0cu3r for your respond, it help. 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.