homepage Welcome to WebmasterWorld Guest from 54.243.13.30
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
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/*
luvvips




msg:4502388
 8:35 am on Oct 1, 2012 (gmt 0)

Hi,

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=1
www.domainname.com/testimonials.php?page=2
www.domainname.com/testimonials.php?page=3
www.domainname.com/testimonials.php?page=4 and so on

Another URLs OLD:
www.domainname.com/reviews.php?page=i-was-concerned-about-100-success-rate
www.domainname.com/review.php?page=i-am-impressed-with-your-quick-information
www.domainname.com/review.php?page=thank-you-for-all-you-have-done-for-us
... and so on

Now the structure has been changed with WordPress. Now the above URLs look like.
www.domainname.com/testimonials
www.domainname.com/testimonials/page/2
www.domainname.com/testimonials/page/3
www.domainname.com/testimonials/page/4
... and so on

Another URLs NEW:
www.domainname.com/i-was-concerned-about-100-success-rate
www.domainname.com/i-am-impressed-with-your-quick-information
www.domainname.com/thank-you-for-all-you-have-done-for-us
... 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]
</IfModule>
# END WordPress

Thanks in advance.

 

g1smd




msg:4502421
 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).

luvvips




msg:4502462
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved