Jump to content


Photo

Mod_Rewrite fails - SUSE 10.1


  • Please log in to reply
4 replies to this topic

#1 windyweather

windyweather
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • LocationCoos Bay, OR

Posted 06 October 2006 - 07:26 PM

I'm trying to get WordPress to work on Apache on SUSE 10.1. It looks like a problem with Mod_Rewrite.
I don't suspect a problem with Apache, but a problem with the config on SUSE.
But to reduce the problem to more manageable test case, I tried the following:

YAST shows REWRITE enabled.
I've restarted the server, and rebooted.

Apparently mod_rewrite is not enabled. Wordpress doesn't work with permalinks and a simple test doesn't work either.
Any tricky business that I need to know? Any suggestion for a simple test? One test I saw suggested that I would get an error on RewriteEngine On if the module were not loaded. But apparently that is not the case.

Pretty much no URL is handled. For the test case below:
http://localhost/tes...ite/content.php works as well as ... /content.php?whatever=somevalue
but
http://localhost/tes...write/products/  gives a 404 as does
http://localhost/tes...oducts/1123123/

I've just tried to build a simple example since wordpress is not exactly straightforward to diagnose.
So it looks like mod_rewrite is not enabled, even tho YAST says so.

Here's an archive of the entire apache config tree.

Thanks,
ww

.htaccess
Options +FollowSymLinks
AllowOverride All
RewriteEngine On

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test-rewrite/
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/products$ /test-rewrite/content.php?action=product_list [NC]
RewriteRule ^/products/([0-9]+)$ /test-rewrite/content.php?code=$1 [NC]
RewriteRule . /test-rewrite/content.php [L]
</IfModule>

content.php
<html xmlns="http://www.w3.org/1999/xhtml">

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Test MOD_REWRITE</title>

</head>
<body>

<h2>Parameter List</h2>
<?php

foreach ( $_GET as $key => $value )
{
	print( "$key = $value<br>" );
}

?>

</body>
</html>


#2 windyweather

windyweather
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • LocationCoos Bay, OR

Posted 08 October 2006 - 10:13 PM

Ok. Looks like I solved it.
(1) Must have AllowOverride All in the <Directory> or .htaccess before rewrite rules will work.
(2) Must have Options FollowSymLinks enabled in <Directory> as well.

Sigh...


#3 Bill_VA

Bill_VA
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 06 March 2007 - 10:17 PM

Windy, I'm coming up against the same deal.  I have SUSE 10 and YaST says it's enabled, but even the simplest rewrite function doesn't work.

I have AllowOverride All and Options FollowSymLinks enabled in <directory>.

I've actually got a thread going on another site: http://forums.devnet...ic.php?p=362883

If you could help that would be great.

#4 windyweather

windyweather
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • LocationCoos Bay, OR

Posted 07 March 2007 - 01:17 AM

Bill_VA,

I'm no expert.. I solved my problem by doing (1) and (2) above...
I suggest you carefully compare the config that I posted as an archive - follow above link - with yours, and then make the (1) and (2) changes.
Sorry, but I don't have any more to add.

Good luck.
ww


#5 Bill_VA

Bill_VA
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 07 March 2007 - 03:09 PM

ww,

That did it, I just replaced my Apache files with yours, made some edits, and I'm good to go.  I wish I had the time to figure out what it was.

Thanks again!!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users