Forum Moderators: phranque

Message Too Old, No Replies

htaccess rewrite rule for wordpress site

         

11mike58

3:22 pm on Sep 16, 2011 (gmt 0)

10+ Year Member



Hi

Hope someone can help me out here. I am new on this forum.

I have a wordpress site (www.my-site.com) that creates -

www.my-site.com/page/2/
www.my-site.com/page/3/ and so on.

I need a htaccess rewrite apache rule that takes www.my-site.com/page/anything and rewrites it to our home page (www.my-site.com). It will needs to be inserted above the Wordpress section in htaccess. Could someone please help?

Thanks so much, I appreciate the help!

g1smd

3:48 pm on Sep 16, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Rewrite? Are you sure? What about a redirect?

Choose your word carefully.

Another thing. Why?

Both actions can be very damaging to your site spidering and indexing (a rewrite will create infinite Duplicate Content, a mass redirect to the root page of a site signals "poor technical quality").

So do you want to shoot yourself in the foot or in the hand?

iamzippy

4:58 pm on Sep 16, 2011 (gmt 0)

10+ Year Member



The reason you're getting /page/x/ is because WordPress is chunking your Home Page (Front Page?) posts into pre-defined blocks, or pages. Each of those 'pages' is just a portion of your front page.

Go to Settings : Reading : 'Front page displays', and play with the 'Blog pages show at most' option.

Be careful: too many posts-per-page can make your front page take ages to load.

HTH.

iamzippy

5:08 pm on Sep 16, 2011 (gmt 0)

10+ Year Member



Having said that, and thought about it... if you've actually created a custom home page, you should choose the 'static page' option and select your preferred page from the 'Front Page' drop-down.
(gulp!)

You don't need any redirecting.