How should I edit .htaccess?

Hello,

I have a simple linkcloaker script, that is very easy to install.
In the past I’ve installed it without much trouble on other webhosts.

But now I get errors on 000webhost.

The message is:
Create rewrite - Failed!
Unforunately, .htaccess could not be modified.
You must add the following lines to your .htaccess file in the root folder (usually www or public_html) of your website:
RewriteEngine On
RewriteRule ^goto/(.+)$ /alc/out.php?desc=$1 [L]

I edited .htaccess as follows, but that is apparently wrong:

Do not remove this line, otherwise mod_rewrite rules will stop working

RewriteBase /home/a8908842/

RewriteBase /

RewriteEngine On
RewriteRule ^goto/(.+)$ /alc/out.php?desc=$1 [L]

Suggestions are very welcome.

Thank you for your tips!

All the best,
JPW

Hello,

What folder is .htaccess file is saved? (/ root, public_html, …)
You can follow the instructions on the FAQ’s of 000webhost:

Do you support .htaccess? What should I know about it ?

I try with the following contents:


RewriteEngine On
RewriteBase /
RewriteRule ^goto/(.+)$ /alc/out.php?desc=$1 [L]

Hey,

Thanks for the tip.

I’ve tried this edit of .htaccess:

Do not remove this line, otherwise mod_rewrite rules will stop working

RewriteEngine On
RewriteBase /
RewriteRule ^goto/(.+)$ /alc/out.php?desc=$1 [L]

But unfortunately I get the same error message as before.

The .htaccess file was originally located inside the public_html folder and I left it in there.

Thanks again:confused:
JPW

I’m not understanding very well the problem. Now that I reread your first message I have doubts:

Can you give a URL to the page with problems (page showing the error)?

The error says “Unforunately, htaccess Could not be modified.” Is it your script trying to modify the htaccess file?

This is the page http://www.fortvne.com/alc/install.php
After filling in the form and clicking install, you arrive at the same url again.

When the install is done you have to rename install.php before using the script.

This is what I get :

(Sorry I left the first part out earlier on. I thought it was not so important, but now that you mention it … :rolleyes: )


Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/.htaccess) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /home/a8908842/public_html/alc/install.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 53

Free Web Hosting

PHP Error Message

Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/.htaccess) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /home/a8908842/public_html/alc/install.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 54

Free Web Hosting

PHP Error Message

Warning: fopen(/usr/local/apache/htdocs/.htaccess) [function.fopen]: failed to open stream: Operation not permitted in /home/a8908842/public_html/alc/install.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 54

Free Web Hosting
Step 1 of 3: Create database tables - Success!
Step 2 of 3: Create config.php - Success!
Step 3 of 3: Create rewrite - Failed!
Unforunately, .htaccess could not be modified.
You must add the following lines to your .htaccess file in the root folder (usually www or public_html) of your website:
RewriteEngine On
RewriteRule ^goto/(.+)$ /alc/out.php?desc=$1 [L]

JPW

so how the final solution, need some trial to make script working perfect.