Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

mod_rewrite local windows machine not working.

Posted on 2014-03-25
6
946 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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