You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Blomstrom <da...@yahoo.com> on 2005/08/15 18:18:34 UTC

[users@httpd] Why isn't mod_rewrite working?

Mod_rewrite actually seems less difficult than I at
first imagined. However, I'm doing something wrong, as
it isn't working yet.

These are the steps I've followed:

1. Added this to my httpd conf file:

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

2. Verified that my .htaccess file is functioning

3. Pasted this in my .htaccess file:

* * * * *

# You don't need to restart anything after modifying
.htaccess.
# Add /? before first $ in every row if you want
optional trailing slashes.
RewriteEngine On
RewriteRule ^test\.htm$ test.php [L]

RewriteRule ^stacks/([a-zA-Z]+)/?$
stacks/index.php?taxon=$1 [L]
RewriteRule ^kids/stacks/([a-zA-Z]+)/?$
kids/stacks/index.php?taxon=$1 [L]
RewriteRule ^topics/([a-zA-Z+]+)/?$
topics/index.php?topic=$1 [L]

# More specific examples...
# RewriteRule ^stacks/(Animalia|Chordata|Mammalia)/?$
stacks/index.php?taxon=$1 [L]
# RewriteRule
^kids/stacks/(Animalia|Chordata|Mammalia)/?$
kids/stacks/index.php?taxon=$1 [L]
# RewriteRule ^topics/(Biomes|Tundra|Tundra\+Mammals)$
topics/index.php?topic=$1 [L]

* * * * *

(I also tried it earlier without the /? for trailing
slashes.)

But it isn't working. My online page at
http://www.geozoo.org/stacks/ (which doesn't have
mod_rewrite yet) works just like my local page. If you
type in www.geozoo.org/stacks, it defaults to
www.geozoo.org/stacks/ Clicking "Aves" on the right
then yields a dynamic link -
http://www.geozoo.org/stacks/index.php?taxon=Aves

Have I missed a step, or is something else wrong?

Thanks.



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Why isn't mod_rewrite working?

Posted by Krist van Besien <kr...@gmail.com>.
On 8/15/05, David Blomstrom <da...@yahoo.com> wrote:
> I just discovered that mod_rewrite IS working. When I
> click on my links, I get dynamic URL's. But if I type
> http://geozoo/stacks/Animalia directly into the
> browser, it works just fine.
> 
> So I guess the next step is fixing it so that SEO
> friendly links are produced when I click on a link. Is
> this something I'd do with mod_rewrite, or do I need
> to change my PHP display script somehow?

This you will need to do in your PHP script. mod_rewirte only works on
the request URL.


Krist
-- 
krist.vanbesien@gmail.com
Solothurn, Switzerland

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Why isn't mod_rewrite working?

Posted by David Blomstrom <da...@yahoo.com>.
I just discovered that mod_rewrite IS working. When I
click on my links, I get dynamic URL's. But if I type
http://geozoo/stacks/Animalia directly into the
browser, it works just fine.

So I guess the next step is fixing it so that SEO
friendly links are produced when I click on a link. Is
this something I'd do with mod_rewrite, or do I need
to change my PHP display script somehow?

Thanks.


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org