Ivan Torres
Ivan Torres

Reputation: 111

How can I redirect to a special page when I have parameters in url slashes?

For example, I want the users to be able to go to a tour using a link like this:

page.com/tour/name

How can I make it, like redirecting to tour.html and then loading there the info using the name parameter in the URL? Using JS.

Upvotes: 0

Views: 30

Answers (1)

Ginezmtz
Ginezmtz

Reputation: 26

You can use this lines in the .htaccess file

RewriteEngine on
RewriteRule ^tour/([^/]+).php /page.php?search=$1 [NC]

Upvotes: 1

Related Questions