Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

mod_rewrite local windows machine not working.

Posted on 2014-03-25
6
Medium Priority
?
996 Views
Last Modified: 2014-03-31
apache 2.4 and php 5.5 on windows local machine.

First time using mod_rewrite. I have read everything I can find. I can't get this to work. I have made setting changes in httpd.conf as I have read others have done. Nothing has worked. I am not getting any sign of life out of this. Can someone help me please. Thanks.

http://localhost/myfolder/index.php
http://localhost/myfolder/index.php?p=register

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^register/?$  index.php?p=register [NC,L]
</IfModule>

I am expecting this:
http://localhost/myfolder/register
0
Comment
Question by:kadin
  • 4
  • 2
6 Comments
 
LVL 9

Expert Comment

by:Trenton Knew
ID: 39954936
did you enable the module?

a2enmod rewrite from the command line

That might be linux only though...
0
 
LVL 9

Expert Comment

by:Trenton Knew
ID: 39954941
also, check that you may have to change the AllowOverride variable from "none" to "all"

helpful link? http://www.webdevdoor.com/php/mod_rewrite-windows-apache-url-rewriting/
0
 

Author Comment

by:kadin
ID: 39954949
Thanks for your response.
Your first suggestion. I do not know how to do. By command line I guess you mean cmd.exe.
I tried everything in your second post. I saw no change in behavior. Still don't work.

I am using apache 2.4 not 2.2. Maybe that is the problem. Maybe I should install an older version. I don't know if an older version will work with php 5.5 though.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:kadin
ID: 39955072
My directory looks like this:

apache24 folder
      htdocs folder
            mysite folder
                  includes folder
                  modules folder
                  .htaccess
                  index.php
0
 

Accepted Solution

by:
kadin earned 0 total points
ID: 39957991
I solved it myself.

Turns out it was working all along. What I discovered was that the link I was using to test the web pages was:

<a>href="index.php?p=register"</a>    // link to page
http://localhost/mysite/index.php?p=register   // made address bar look like this.

<a>href="register"</a>    // new link to page
http://localhost/mysite/register    // made address bar look the way I want it to.

I did not know the links have to change.
0
 

Author Closing Comment

by:kadin
ID: 39966134
I give thanks to the one person who attempted to help me.
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question