Welcome to WebmasterWorld Guest from 54.159.44.227

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

apache set up problem? mod rewrite

     

topr8

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

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



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?

jdMorgan

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

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



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.

Jim

topr8

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

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



apache 2, so can't be that!

(tried it anyway - no luck)

jdMorgan

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

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



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.

    Jim

  • topr8

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

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



    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)

     

    Featured Threads

    Hot Threads This Week

    Hot Threads This Month