Aaron
Aaron

Reputation: 11673

Clean Urls with mod_rewrite

How do I make it so when a user clicks on, http://localhost/jobwehave.co.za/job/1

They are shown the page for http://localhost/jobwehave.co.za/job?=1

But the url still says http://localhost/jobwehave.co.za/job/1

I am using mod_rewrite in an .htaccess file at the root of the site.

Upvotes: 0

Views: 380

Answers (2)

Michael Berkowski
Michael Berkowski

Reputation: 270617

RewriteEngine On
RewriteRule /jobwehave.co.za/job/([0-9]+)$ /jobwehave.co.za/job?job=$1 [L,QSA]

Upvotes: 2

Richard Adnams
Richard Adnams

Reputation: 3128

Try this,

RewriteRule ^jobwehave.co.za/job/(\d+)$ jobwehave.co.za/job?id=$1

Rick.

Upvotes: 2

Related Questions