nowayyy
nowayyy

Reputation: 917

htaccess rewrite URL for dynamic content

I am wondering how would I change the url from:

single.php?id=1

to:

quote-1

Each submitted data has an id, of course. They can go to the URL, the id of the "quote" to get the quote. How would the URL rewrite look? I've tried to use tools online, but ether they didn't work or I didn't understand how to use it.

Upvotes: 0

Views: 390

Answers (1)

user142162
user142162

Reputation:

Place the following your .htaccess file:

RewriteEngine on
RewriteRule quote-(\d+) single.php?id=$1 [QSA]

mod_rewrite documentation

Upvotes: 5

Related Questions