Forum Moderators: phranque

Message Too Old, No Replies

.htaccess doesn't work

.htaccess doesn't work

         

macdar

9:08 pm on Nov 9, 2004 (gmt 0)

10+ Year Member



Hi,
I decided to play around with linux..I set up my own dns server.. I have a domain running on my local host..
And everything went pretty well till I tried to use .htaccess file.

that's my simple .htaccess file:
RewriteEngine On
RewriteRule blah.html [mydomain.com...]

I set AllowOverride to All in the httpd.conf file..

I can access [mydomain.com...] but when I type [mydomain.com...] - it says that the doc could not be found..

So, my guess is that basically .htaccess is not visible for apache..How to set it up correctly?

Thanks.

jdMorgan

9:17 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This recent thread may assist you: [webmasterworld.com...]

Jim

freeflight2

9:18 pm on Nov 9, 2004 (gmt 0)

10+ Year Member



is .htaccess readable for the user apache is running under (probably nobody), does your error log say anything?

macdar

9:43 pm on Nov 9, 2004 (gmt 0)

10+ Year Member



Thanks guys for your reply.

Jim, php has nothing to do with that.. I'm trying to use rewrite rule for simple html files - just to make sure that .htaccess works - but unfortunately it doeasn't.. I set AllowOverride to All and still nothing..

freeflight2, my log file says basically that blah.html doesn't exist..

thanks.

coopster

9:46 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



macdar, jd was referring to message #4, which is true for any mod_rewrite directives, php or not. Have another look at that checklist ;)

macdar

10:07 pm on Nov 9, 2004 (gmt 0)

10+ Year Member



Thanks Coopster.
I'm sorry about that, as you can see I'm totally new to that. Could you tell me where should be the AddModule enabled? I don't have it within my httpd.conf file and php.ini neither.

Currently my .htaccess file looks like this:

Options +FollowSymLinks
RewriteEngine On
RewriteRule blah.html [mydomain.com...]

and I'm tryng to type [mydomain.com...] and it doesn't want to show me index.html..it says: "The requested URL /blah.html was not found on this server"..

coopster

10:32 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If it's Apache 2.0 you won't be using AddModule, as jd stated in that message. Look in your
httpd.conf
file for
LoadModule rewrite_module modules/mod_rewrite.so
If there is a comment in front of it, for example...
#LoadModule rewrite_module modules/mod_rewrite.so
...you need to uncomment that line (remove the # sign) and then save the file. Don't forget to stop and start Apache again.

macdar

10:53 pm on Nov 9, 2004 (gmt 0)

10+ Year Member



I'm running on apache 1.3.26..
And ss far as LoadModule, it has been uncommented already..

jdMorgan

5:10 am on Nov 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



macdar,

Please go through the list in message #4 of that thread, and tell us whether or not your server has met each configuration requirement. We cannot help you unless you are very specific about your problem, and that checklist covers most common configuration problems, including the minor Apache version dependencies.

I suspect you may be missing the Options setting.

Jim