Page 1 of 1

mod_rewrite

PostPosted: 02. October 2007 23:14
by carlwenrich
I uncommented the line (in httpd.conf) to load mod_rewrite.so but the htaccess file containing the rewrite engine and rules is still being ignored. Is there something else I have to change?

PostPosted: 02. October 2007 23:47
by Wiedmann
Maybe "AllowOverride".

thanks anyway

PostPosted: 03. October 2007 06:54
by carlwenrich
I tried setting it from None to All, but it didn't change anything. I'm assuming that if I stop and then start apache, that's all I need to do to pick up the changed httpd.conf file.

PostPosted: 03. October 2007 07:08
by Izzy
...I'm assuming that if I stop and then start apache, that's all I need to do to pick up the changed httpd.conf file

Every time you edit a configuration file restart Apache to have the edits recognized.

In your .htaccess file don't forget to turn on the rewrite engine.
RewriteEngine on

Item 4 D explains.
http://community.apachefriends.org/f/viewtopic.php?t=20957

=================================================
Take a look at the new DeskTopXampp launch control for XAMPP and XAMPPlite (DTX.exe)
http://nat32.com/dtx/
posted by ridgewood:
http://community.apachefriends.org/f/viewtopi ... 967#103967
Also available here: http://zedfiles.com/DTX/
I highly recommend DTX.
=================================================

Thanks Izzy... but...

PostPosted: 03. October 2007 11:54
by carlwenrich
The "RewriteEngine on" is in a local htaccess (it's not .htaccess) file (remember, I'm under windows) but it still doesn't work. The Rewrite rules are also in this local file. It works on the demo site do the guy who wrote the site scripts tells me it's definitely my server that's the problem. My problem is that I don't know what I have to do to my server to enable this feature.

PostPosted: 03. October 2007 12:40
by Izzy
htaccess won't be recognized by Apache.

It needs to be .htaccess even under Windows.

If Windows baulks at the file when trying to open it, try this:
Drag the file into your text editor, edit, then save it.

Also try associating the .htaccess file with your text editor.

When you get the window "Windows cannot open this file:"
Click on "Select open from a list" and select your text editor (notepad perhaps).
Tick the box "Always use this program to open this kind of file".
Click OK.

Now when you click on .htaccess file it will open in your notepad for editing.

This .htaccess file is defined in your httpd.conf file not htaccess at about line 252 in a default httpd.conf file.
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>

AccessFileName .htaccess
There is nothing wrong with the server.


=================================================
Take a look at the new DeskTopXampp launch control for XAMPP and XAMPPlite (DTX.exe)
http://nat32.com/dtx/
posted by ridgewood:
http://community.apachefriends.org/f/viewtopi ... 967#103967
Also available here: http://zedfiles.com/DTX/
I highly recommend DTX.
=================================================

Thanks again. Here's what I needed to do:

PostPosted: 03. October 2007 18:27
by carlwenrich
1 - Rename htaccess to .htaccess
2 - Uncomment the mod_rewrite loading in httpd.conf

Thanks to everyone who helped with this.

Carl