Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Need Help With mod_rewrite / RewriteRule


  • Please log in to reply

#1
jimcgr

jimcgr

    Member

  • Member
  • PipPip
  • 54 posts
I need to do something really basic using the RewriteRule command from a htaccess file. Almost nothing works.

Please can someone help with making a simple RewriteRule command work?

Thanks!
  • 0

Advertisements


#2
admin

admin

    Founder Geek

  • Administrator
  • 24,504 posts
What are you trying to do?
  • 0

#3
jimcgr

jimcgr

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
Hello,
Thanks for helping!

In the root directory of this site: mymsq.net

I have 3 files:
- index.html
- .htaccess
- test.php

The content of the .htaccess is:
RewriteEngine On
RewriteRule testing.html index.html
RewriteRule test/testing.html index.html
RewriteRule ^/([a-z]+)/([a-z]+)$ /test.php?$1=$2

Now, this is working:
- http://www.mymsq.net/testing.html
This is working as well:
- http://www.mymsq.net/test/testing.html
But this doesn't:
- http://www.mymsq.net/param/abc

It is suppose to do just like:
- http://www.mymsq.net...t.php?param=abc

The content of the php file is simply:
<?php echo $param ?>

I took my rewrite code from this page:
http://webdesign.abo.../a/aa071006.htm

It should work no? Can you see anything I'm doing wrong?
  • 0

#4
jimcgr

jimcgr

    Member

  • Topic Starter
  • Member
  • PipPip
  • 54 posts
Forget about my request, looks like the correct line to use was:
RewriteRule ^([a-z]+)/([a-z]+)$ test.php?$1=$2
( had to remove those / )

thanks
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP