Pass http://example.com/10 get http://example.com?path=10

When a user entered http://example.com/10, the browser should pass the url as http://example.com?path=10.

We need an htaccess code for this.

Thank you in advance.
LVL 1
yahoolaneAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
yahoolaneConnect With a Mentor Author Commented:
solved.

RewriteEngine on
RewriteRule ^([0-9a-zA-Z]+)$ index.php?path=$1
0
 
Michael WorshamInfrastructure / Solutions ArchitectCommented:
You will need mod_rewrite enabled in your Apache instance

Try this:

Options +FollowSymLinks
RewriteEngine  on
RewriteRule ^/(.*)$ /?path=$1 [R=301,L]

_or_

Options +FollowSymLinks
RewriteEngine  on
RewriteRule ^/(.*)$ http://www.example.com?path=$1 [R=301,L]
0
 
yahoolaneAuthor Commented:
solved my problem
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.