Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

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.
0
yahoolane
Asked:
yahoolane
  • 2
1 Solution
 
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.

RewriteEngine on
RewriteRule ^([0-9a-zA-Z]+)$ index.php?path=$1
0
 
yahoolaneAuthor Commented:
solved my problem
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now