Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
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

  • Community Leader
  • 24,639 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