0

I have a hosted account not linked to any domain at /~me.

In the top level of my home directory I have a .htaccess file:

Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteRule 123.html cgi-bin/example.php [nc] 

The full path of example.php is /~me/public_html/cgi-bin/example.php. However /~me/123.html returns a 404.

Is my .htaccess not valid?

6
  • 1
    /~me/public_html/cgi-bin/example.php contains the above file - what do you mean? Where's the .htaccess file located? Commented Nov 30, 2012 at 5:02
  • "in the top level of my home directory" - /~me. The full path of file cgi-bin/example.php is at /~me/public_html/cgi-bin/example.php. Commented Nov 30, 2012 at 10:37
  • Which directory is your document root - ~me or ~me/public_html? Commented Nov 30, 2012 at 16:31
  • /~me but it's a pretty standard hosting idea that web requests get redirected to public_html. The .htaccess file in ~me should still work. That's how it works in my other host provider for example. Commented Nov 30, 2012 at 16:55
  • Well, if you put a test.html file in ~me, not in public_html, does it work? Commented Nov 30, 2012 at 17:00

1 Answer 1

0

The issue was the shared hosts Apache mod_rewrite config that identifies which script to run by the host. I wasn't using a hostname initially, just raw IP, so the server didn't which user account directory to find the target script in.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.