homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Redirect OLD URLs *.php?page=* to new URLs */page/*
Redirect OLD URLs *.php?page=* to new URLs */page/*

5+ Year Member

Msg#: 4502386 posted 8:35 am on Oct 1, 2012 (gmt 0)


My old website was in .php and currently, I am using WordPress script. I would like to redirect all my OLD URLs to new URLs.

My OLD site URL looks like this:
www.domainname.com/testimonials.php?page=4 and so on

Another URLs OLD:
... and so on

Now the structure has been changed with WordPress. Now the above URLs look like.
... and so on

Another URLs NEW:
... and so on

My all old URLs are in Google and other search engines. I would like to redirect them (all my OLD URLs) to new URLs. E.g. testimonials.php?page=2 to testimonials/page/2 etc

Please help me to redirect them through .htaccess

My current .htaccess looks like as below:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Thanks in advance.



WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Msg#: 4502386 posted 10:27 am on Oct 1, 2012 (gmt 0)

This question (or a close relation) is asked most weeks here.

If the new URL re-uses elements from the old URL you can do it with simple rules, so you'll be able to do that with many of the URLs.

Where the old URLs have no such re-usable features you should either:
- use a custom Wordpress redirect plugin or extension, or
- rewrite (that's internally rewrite, not redirect) all requests for old URLs to a simple PHP script that contains an array of old and new URLs, looks up the new URL and sends a 301 HEADER to the new URL, or sends a 404 HEADER if the old URL does not exist (i.e. for all unused ID numbers).


5+ Year Member

Msg#: 4502386 posted 1:05 pm on Oct 1, 2012 (gmt 0)

Thanks so much for your reply. Its done by using the Redirection plugin

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved