Page 3 of 4

Posted: Tue Mar 06, 2007 2:25 pm
by Bill_VA
yep, sure does

Posted: Tue Mar 06, 2007 3:47 pm
by Bill_VA
I opened YaST to check my setup, opened Network Services, opened HTTP Server, opened Server Modules, it indicates that rewrite is enabled and running.

Posted: Tue Mar 06, 2007 4:26 pm
by RobertGonzalez
This has to be something with the configuration for Apache. At least everything leads me to think that. But I am not sure what.

The last time I configured apache to use mod_rewrite (which was a few days ago) it was a matter of making the <directory /> entry into the conf and adding the Options FollowsymLinks and AllowOverride All portions to it. After that it was only a matter of tuning my rule set to get it working. I am totally not sure at all of what could be causing this issue for you.

Posted: Tue Mar 06, 2007 5:11 pm
by Bill_VA
Here's my <directory> tag:

Code: Select all

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Deny from all
</Directory>
Please don't give up on me, I'm sure it's something simple.

Posted: Tue Mar 06, 2007 5:18 pm
by RobertGonzalez
Try this...

Code: Select all

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

Posted: Tue Mar 06, 2007 7:20 pm
by Bill_VA
No change.

Here's a stupid question. Is the .htaccess file just a text file?

Posted: Tue Mar 06, 2007 11:38 pm
by RobertGonzalez
Yes it is, but it for certain has to be named .htaccess and it should be written with a plain text editor.

Posted: Wed Mar 07, 2007 6:39 am
by Bill_VA
That's what I thought, I'm kinda grasping at straws now. What else can I check?

Posted: Wed Mar 07, 2007 8:47 am
by Bill_VA
Good new and bad news. I found another forums site that had someone's entire apache setup all zipped up. I made a copy of my existing Apache folder and then unzipped their files into my folder, edited a few settings and then I started to get 500 server error issues instead of 404 and found that the rewrite function was now working but causing an error. I played around with the RewriteRule a bit and found that this works perfectly:

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)?$ /mysite/index.php?city=$1&page=$2&function=$3 [L]
</IfModule>
The only downside to this is that I have no clue as to what exactly it was that fixed it.

Robert, thanks so much for the help. I'm sure that given my rookie status, you'll see other posts from me in the future.

Bill

Posted: Wed Mar 07, 2007 11:09 am
by RobertGonzalez
I think you can use the diff command at the command line to view the differences between your conf and the one you unpacked.

Posted: Wed Mar 07, 2007 11:12 am
by Bill_VA
What's the diff command? Can you give me an example?

Posted: Wed Mar 07, 2007 11:46 am
by RobertGonzalez

Code: Select all

user@host $> diff file1 file2

Posted: Mon Mar 12, 2007 1:44 pm
by Bill_VA
I found the difference in a file that causes this to work or not. In the /etc/apache2/
default-server.conf file, the <Directory "/srv/www/htdocs"> tag must have

Code: Select all

Options FollowSymLinks
AllowOverride All

Posted: Mon Mar 12, 2007 2:37 pm
by RobertGonzalez
So it is working then? I wonder why the setup I mentioned a few posts up didn't work, as the <directory /> should have affected everything in the root.

Posted: Mon Mar 12, 2007 2:49 pm
by Bill_VA
Idunno, go figure. The Options FollowSymLinks and AllowOverride All lines apparently need to be in both places.