.htaccess redirect 301 URL with parameter

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.x extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
escw0rm
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Mar 26, 2014 7:57 am

.htaccess redirect 301 URL with parameter

Post by escw0rm » Mon May 12, 2014 2:32 pm

Hello,

I have a old link that is:
http://mydomain.com/index.php?page=omNeh&id=2

and i want to redirect the visitor to:
http://mydomain.com/om

I use URL rewrite in joomla to get short and SEO links.


Anyone that can teach me how to solve this problem? The description above is one example of hundreds of links i'm going to redirect.

Thanks

escw0rm
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Mar 26, 2014 7:57 am

Re: .htaccess redirect 301 URL with parameter

Post by escw0rm » Tue May 13, 2014 7:08 am

So now I got it work almost:

Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{QUERY_STRING} ^page=nyheter$
RewriteRule ^index.php /about [NC,R,L]

this example will take /index.php?page=nyheter redirected to /about
BUT my problem is:

How to use multiplie parameters? like this:
index.php?page=nyheter&id=1

escw0rm
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Mar 26, 2014 7:57 am

Re: .htaccess redirect 301 URL with parameter[solved]

Post by escw0rm » Tue May 13, 2014 8:57 am

Hello again.


Solved the problem by my self.

here is my code for multiplie parameters:
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{QUERY_STRING} ^page=nyheter&id=1$
RewriteRule ^index.php http://mydomain.com/nyheter.html$1? [R=301,L]

and it remove also the parameters from the final url.

ngxuanthuan
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun May 18, 2014 11:11 am

Re: .htaccess redirect 301 URL with parameter

Post by ngxuanthuan » Sun May 18, 2014 11:25 am

thanks you


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”