Solved

mod_rewrite local windows machine not working.

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Redirect all pages to one specific page 1 93
new line in php on linux server 6 169
Leverage Browser Caching 7 57
Ubuntu 14 with Apache 7 68
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
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…

744 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

12 Experts available now in Live!

Get 1:1 Help Now