Solved

mod_rewrite local windows machine not working.

Posted on 2014-03-25
6
934 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

948 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now