.htaccess disappeared, and wont work properly
Hi LQ's
I have a server running Debian, and it's running PHP5, apache2, mysql and pure ftp... but when i upload .htaccess and press F5 the .htaccess file disappears... but i it still there. the .htaccess file look like this Code:
RewriteEngine on with content PHP Code:
it returns Array ( [id] => ) |
Hi and welcome to LQ,
Your RewriteRule works here: It gives: Array ( [id] => test) Are you sure you're using the correct .htaccess? Because you say that after uploading you cannot see it anymore, it could be that you don't have permissions to overwrite it and you're using a wrong .htaccess. |
no if i try to upload another .htaccess does my FTP client ask me if i want to overwrite the old .htaccess file, so it is there, but i can't see it
|
Yes, but are you sure that the existing .htaccess is overwritten by the one you are uploading?
Could you download it back to see if it's the correct one? |
yes i can download it, by using my browser after i have turned Deny from all off in apache2.
but i cant see it in my ftp client |
Hi,
Leave the "Deny from all" the way it was, because otherwise .htaccess could be downloaded/viewed from others. What ftp client are you using? Are you sure it can show "hidden" files (files that stat with a dot)? Anyway, could you try the following rule and see if it works? Code:
RewriteRule ^php_show/(.*)$ php_show.php?id=$1 |
My FTP client is Filezilla, and that last code you send returned
Array ( [id] => ) |
So, is the .htaccess you've downloaded the same as the one you're trying to use and it's not working?
And if yes, are you sure it's not your browser cache that gives you always the same page? Try this: Code:
RewriteRule ^php_show/(.*)$ /php_show.php?blah=$1 BTW you can enable rewrite logging to find out what happens with your rule. To do so, add in httpd.conf the following Code:
RewriteLogLevel 9 |
I just found out even without a .htaccess file i can go to my php_show.php by typing
server ip/php_show so i think that is my problem, but how to turn that access possibility off? |
Are you sure it's not your browser's cache and you don't have other rewrite rules in httpd.conf, or the included *.conf files?
Change the rule LHS to something else (like the following) and see what you get when you visit: http://x.x.x.x/whatever/blah: Code:
RewriteRule ^whatever/(.*)$ php_show.php?id=$1 |
now i get a error 404 file
|
What does the error says? It can't find /whatever? If that's the case, most likely mod_rewrite does not work or is not loaded.
1.Run Code:
a2enmod rewrite 2. Also quoting from this Quote:
Regadrs |
i want to say i used this tut to setup my server
http://www.howtoforge.com/perfect-se...nny-ispconfig3 can it have anything to do with it? i have also installed ffmpeg and flvtool2 but i think i dont know how to use ISPconfig properly |
According to the tutorial you've followed, mod_rewrite is eanbled.
So you have to check if there is a "AllowOverride all" in /etc/apache2/apache2.conf or in /etc/apache2/sites-enabled/000-default. Or, you can put the rewrite stuff directly in /etc/apache2/sites-enabled/000-default and restart apache to see if .htaccess is the problem |
etc/apache2/sites-available/000-default <- is empty on my server, but i think it's ISPconfig that is doing it, so i think i will formate my server and not install ISPconfig :D
|
All times are GMT -5. The time now is 01:06 PM. |