homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

RewriteRule not executed
apache mod_rewrite

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

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
ServerAdmin webmaster@example.com
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
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

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

Thanks for any help you can give.



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

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




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

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?



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

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.


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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved