user1511766
user1511766

Reputation: 125

mod_rewrite 404 error trying to rewrite URL

I have website that is using unfriendly URLs and I want to change them using mod_rewrite.

I have a URL like this:

http://www.website.nl/?p=2

and I want it to be

http://www.website.nl/about-us

When I use this on my local server it works correct but on the live webserver it doesnt

I use this code in my .htaccess:

Options +FollowSymLinks

RewriteEngine On
RewriteRule ^about-us$ /?p=2 [L]

I already checked if mod_rewrite is enabled and in my apache2handler it is enabled so it should work shouldn't it?

What am I missing or doing wrong?

Upvotes: 3

Views: 748

Answers (1)

Stuart M
Stuart M

Reputation: 11588

You may be missing the leading / (forward slash) in your pattern, try:

RewriteRule ^/about-us$ /?p=2 [L]

Upvotes: 1

Related Questions