28, May 2012

mod_rewrite on apache w/ windows - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web hosting talk  >  Configuring your server  >  Apache web server
Topic: mod_rewrite on apache w/ windows
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: mod_rewrite on apache w/ windows  (Read 3824 times)
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« on: Sep 07, 2007, 06:14:30 pm »

i seem to be having some problems with the mod_rewrite module for Apache.. recently I have set up my personal computer (For the 2nd time) as a personal local test server for developing scripts. mod_rewrite seems to work great in the latest release of phpHaze, when uploaded to a live server such as my blog, but when im testing it on my local test server the generated rewritten links are not working, returns a 404 error. I have enabled the apache module mod_rewrite and PHP also picks up the module as being loaded through apache_get_modules(), any idea why this is not working? is there something I am missing?


Last blog : phpHaze 1.59.1 in Development
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: Sep 07, 2007, 06:25:51 pm »

Try to use the directives in your httpd.conf file

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #2 on: Sep 07, 2007, 10:26:06 pm »

im not sure i know exactly what you mean? there was only one place in my apache config that spoke of "mod_rewrite" or anything similair, so i just uncommented that line.

i also tried a few tests that i found in various places on the web and no luck.. im definately a noob when it comes to running my own server especially with all these modules are involved Cool


Last blog : phpHaze 1.59.1 in Development
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #3 on: Sep 07, 2007, 10:30:14 pm »

Don't worry man, none borned knowing everything Smiley

Here is what you have to do :

Code:
<VirtualHost 127.0.0.1>
ServerAdmin xxxxx
DocumentRoot "x:/htdocs"
ServerName localhost
<Directory "X:/htdocs/">
Options All Includes Indexes
RewriteEngine on
# Here you can give your directives
</Directory
</VirtualHost>

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #4 on: Sep 07, 2007, 10:34:16 pm »

ok so im adding this to my apache config file say at the top? of course changing the roots to where my docs are located, what about ServerAdmin xxxxx ? and should </Directory be </Directory> ? sorry for all the questions man Tongue and also, where you have "# Here you can give your directives" is this where I add the "code" for the actual url rewriting? in that case is the htaccess file even required? see i am very confused.. lol so here is my current htaccess file with the rewriting directives

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule page-id-(.*)-view-(.*)-news_id-(.*)\.html$ page.php?id=$1&view=$2&news_id=$3


Last blog : phpHaze 1.59.1 in Development
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Sep 07, 2007, 11:06:41 pm »

start here

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

and you need to read the apache manual to understand virtual hosts

Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Sep 07, 2007, 11:09:57 pm »

I forgot, using mod_rewrite on windows is not easy (depends on a lot of things) Test mod_rewrite on a linux machine otherwise you become crazy Wink

Tim Nash
Global Moderator
Community Supporter ?
Internet Junkie
*****
Posts: 2175
5052 credits
Members referred : 2


Venture Skills - New Media & IT group


« Reply #7 on: Sep 07, 2007, 11:29:00 pm »

Meth0d are you using windows or Linux?

if windows check this thread http://www.webmasterworld.com/apache/3161443.htm
in paticular
Quote
You will have to change the name of .htaccess to something else like "htaccess" without a preceding dot, or "htaccess.txt", and use the AccessFileName directive to tell Apache to use that new filename instead.
which will lead you
http://httpd.apache.org/docs/2.2/mod/core.html#accessfilename

Windows and apache don't play nicely so if you doing serious dev work it might be time to think about a dedicated test box running a LAMP configuration

Would you like to be an SEO, let me help with, The Tim Nash introduction to SEO alternatively for Social media optimisation take a look at the Venture Skills Blog

Last blog : Its all in the mp3s
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #8 on: Sep 08, 2007, 06:04:52 am »

Meth0d are you using windows or Linux?

if windows check this thread http://www.webmasterworld.com/apache/3161443.htm
in paticular
Quote
You will have to change the name of .htaccess to something else like "htaccess" without a preceding dot, or "htaccess.txt", and use the AccessFileName directive to tell Apache to use that new filename instead.
which will lead you
http://httpd.apache.org/docs/2.2/mod/core.html#accessfilename

Windows and apache don't play nicely so if you doing serious dev work it might be time to think about a dedicated test box running a LAMP configuration


thanks but.. this does not work, or at least not for 2.2.4. "AccessFilename" does not exist in my apache config file, so just to see, i added it with this line "AccessFileName htaccess.txt" renamed my .htaccess file to htaccess.txt and still no luck. returns 404 on my local test serv but works fine on live server.

unless of course I am doing something wrong, which is probably the case  Grin
« Last Edit: Sep 08, 2007, 06:40:00 am by Meth0d »


Last blog : phpHaze 1.59.1 in Development
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Sep 08, 2007, 07:32:56 am »

its the directive below the DirectoryIndex directive (at least with apache 2)

aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #10 on: Sep 11, 2007, 06:05:00 am »

its the directive below the DirectoryIndex directive (at least with apache 2)

not really sure what you mean, or what I am supposed to do here.. sorry, remember when it comes to this i have no prior knowledge of how this works at all (apache config and mod_rewrite)


Last blog : phpHaze 1.59.1 in Development
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #11 on: Sep 11, 2007, 07:05:50 am »



not really sure what you mean, or what I am supposed to do here.. sorry, remember when it comes to this i have no prior knowledge of how this works at all (apache config and mod_rewrite)

maybe its better to practice mod_rewrite on some machine where this feature is already working (like most of the shared web hostings)

aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #12 on: Sep 15, 2007, 05:59:45 am »

nah.. that will not work for now.. i need to use my local test machine at home for this as I am changing entire PC's soon and buying a live web server , but in some time.. in the mean time, I need this free solution: set up my winxp unit as a local test machine to properly develop scripts and applications...

so any help from this point?  still have no idea what the prob is.. Sad


Last blog : phpHaze 1.59.1 in Development
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #13 on: Sep 15, 2007, 07:23:28 am »

shared hosting is only a few bucks a month

I get some new laptop next month and I know that I will skip the testing server on this windows computer (didn't used it for month)

believe me mod_rewrite on WAMP su___s (and you have no idea about apache), do the easy way!

aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #14 on: Sep 17, 2007, 10:54:09 pm »

well i didnt use WAMP or any packaged windows thing, i installed one by one by hand and config'd them way I wanted.. and i already have a shared hosting server where my main sites run, i used to do test work there but cant, its to lock-down, cant control error reporting and alot of other annoying things.


Last blog : phpHaze 1.59.1 in Development
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #15 on: Sep 17, 2007, 11:03:30 pm »

well i didnt use WAMP or any packaged windows thing, i installed one by one by hand and config'd them way I wanted.. and i already have a shared hosting server where my main sites run, i used to do test work there but cant, its to lock-down, cant control error reporting and alot of other annoying things.

Smiley

W = windows
A = apache
M = mysql
P =php

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #16 on: Sep 18, 2007, 10:06:14 am »

Method, just install this and everything will work great (I used it to my girlfriend's machine) :

http://www.apachefriends.org/en/xampp-windows.html

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 886
1148 credits
Members referred : 4



« Reply #17 on: Oct 01, 2007, 07:45:44 am »

kind of late for that hehe, but when i reformat in a few weeks i will give that a try, thanks guys Smiley


Last blog : phpHaze 1.59.1 in Development
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7076
Tags : mod_rewrite apache windows Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web hosting talk  >  Configuring your server  >  Apache web server
Topic: mod_rewrite on apache w/ windows
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 09:15:52 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.