WindArtas
WindArtas

Reputation: 11

htaccess 301 for non friendly urls

How do I redirect non friendly urls to X? Found this:

Redirect 301 /oldpage.html http://www.yourdomain.com/newpage.html

But this code only apply to friendly urls or specific files.

I need to do something like:

www.example.com/?option=com_content&view=article&id=66&Itemid=109

to

www.example.com/index.php

Any ideas?

Upvotes: 0

Views: 64

Answers (1)

Wes Smith
Wes Smith

Reputation: 43

If you want to redirect those URLs to a "pretty" URL, you will need rules like:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule \?option=.* ./index.php

If you want to apply it to non-existent URLs, use something like:

ErrorDocument 404 /your_page.html

For more help, see and example like this

Upvotes: 1

Related Questions