homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

apache set up problem? mod rewrite

 8:02 pm on Oct 17, 2004 (gmt 0)

ok have decided to move from asp to php for at least some future projects.

have installed apache on my local windows machine and it is working! set to listen to port 8080 as i have iis as well. php also installed and scripts are running fine, no problems so far

using phpinfo() i can see that mod_rewrite is amoungst the loaded modules.

however i can't get it to work! i've written some rewrite rules in .htaccess but nothing happens, infact i get a 404 page not found error, when i try to go to the url (which should redirect to a different url if the .htaccess rules are being followed)

i have however uploaded the same htaccess file to an account at a new webhost and it does work, so i must have written the rewrite rules correctly, i can only think that there is some apache config setting that i need to change or i need to map the folder in some way that i haven't yet. (although php scripts are running, so it can find the php)

any ideas?



 12:08 am on Oct 18, 2004 (gmt 0)

What version of Apache?

Previous to Apache 2, the mod_rewrite module must be loaded *after* the php module; Otherwise, it won't run properly. This is a common problem, since a lot of people just add the LoadMoadule for php at the end of the list. It should actually go at the beginning of the list or near the beginning. Modules are executed in the opposite order that they are loaded.



 6:06 am on Oct 18, 2004 (gmt 0)

apache 2, so can't be that!

(tried it anyway - no luck)


 12:31 pm on Oct 18, 2004 (gmt 0)

Here's a list of settings you'll need to enable mod_rewrite:

  • LoadModule rewrite_module modules/mod_rewrite.so
  • AddModule mod_rewrite.c
  • AllowOverride FileInfo Options -or-
  • AllowOverride All
  • Options +FollowSymLinks -or-
  • Options +SymLinksIfOwnerMatch -or-
  • Options All

    Addmodule, LoadModule, and AllowOverride are available at the server configuration level only, usually in the httpd.conf file. If you are on a shared server these will not be accessible. AddModule is not used in Apache 2.0 and higher. You can try adding the Options directive to your .htaccess file and testing with a simple rewrite.


  • topr8

     3:42 pm on Oct 18, 2004 (gmt 0)

    great thanks ...

    allowoverride all

    in the httpd.conf file did the trick

    (the problem was on my test server - the remote hosted server was working fine, which was how i was sure there were no errors in the .htaccess itself)

    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