Paolo
Paolo

Reputation: 361

Rewriting urls with htaccess and PHP

I'm trying to rewrite the following URL

www.domain.com/?part=messages

to:

www.domain.com/messages

I've folowed some .htaccess tutorials but I couldn't. How can I make it work?

Upvotes: 1

Views: 211

Answers (1)

anubhava
anubhava

Reputation: 786001

This is pretty simple rule actually:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+?)/?$ /?part=$1 [L,QSA]

Reference: Apache mod_rewrite Introduction

Upvotes: 2

Related Questions