Welcome to WebmasterWorld Guest from 54.226.27.104

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

RewriteRule not executed

apache mod_rewrite

     

quebrada

11:08 pm on Oct 19, 2006 (gmt 0)

10+ Year Member



I am trying to use mod_rewrite for the first time and am having no success

When I enter the url http://www.example.com/some-data.html I go to that file instead of http://www.example.com/some-more-data.html that I am hopeing to see.

<VirtualHost *:80>
DocumentRoot /usr/local/www/vhosts/example.com/htdocs
ServerName example.com
ServerAlias www.example.com
ServerAlias 10.10.10.10
ServerAdmin webmaster@example.com
LogFormat COMBINED
ErrorLog /usr/local/www/vhosts/example.com/logs/error_log
TransferLog /usr/local/www/vhosts/example.com/logs/access_log
HostNameLookups off
RewriteEngine on
RewriteRule ^some-data\.html$ some-more-data.html
<Directory "/usr/local/www/vhosts/example.com/htdocs">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin /usr/local/www/vhosts/example.com/cgi-bin
<Directory "/usr/local/www/vhosts/example.com/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

No error messages and no clues when I restart apache. the url rewrite just doesn't happen.

Thanks for any help you can give.

jdMorgan

11:53 pm on Oct 19, 2006 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



In order to match, your RewriteRule pattern will need a leading slash.

^/some-data\.html$

Jim

quebrada

12:29 am on Oct 20, 2006 (gmt 0)

10+ Year Member



I added the leading slash and that didn't change the result.

Next I added the leading slash to the destination url and this didn't change the result either.

Could you offer another possiblity that I could try?

Thanks

jdMorgan

12:35 am on Oct 20, 2006 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You'll need AllowOverride Options (at a minimum), followed by either Options FollowSymLinks or Options SymLinksIfOwnerMatch, in the vHost container itself, before the RewriteEngine on directive.

If you get a server error, you should check your server error log, as it will likely tell you what the problem is.

Jim

[edited by: jdMorgan at 12:36 am (utc) on Oct. 20, 2006]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month