Oscar Batlle
Oscar Batlle

Reputation: 157

How do i set a page as my homepage?

I have a Page "mydomain.com/wordpress/calientes/" that i want to set as my Main/homepage so when an user go to mydomain.com they can actually see "mydomain.com/wordpress/calientes/" displaying only mydomain.com on the navigator... like 9gag.com does... you go to their website and their main page is actually 9gag.com/hot but you only see 9gag.com on the navigator window unless you click on the "Hot" menu.. you'll see 9gag.com/hot.

I'm playing around with .htaccess :

RewriteRule ^$ /wordpress/calientes/ [L]

But it's not working...

What is the best way to do this?

Upvotes: 0

Views: 77

Answers (3)

Piyush Rishi Singh
Piyush Rishi Singh

Reputation: 41

You need not play any codes to do so. In Settings section of your Wp-admin you can set / or say you can select any predefined or published page/post as front page.

Let me be more clear regarding url structure type you need to follow :

http://xyz.com/wp-admin/options-reading.php

There you will have option to : "Front page displays"

You can select "A static page (select below)" Any desired page /Post As main front page...

Hope you get the point & problem gets resolved .

Upvotes: 1

gwillie
gwillie

Reputation: 1899

not a .htaccess answer, but you can use sql for this

UPDATE `wp_options` SET `option_value` = 2 WHERE `option_name` = 'page_on_front';

just replace option_value with the id of your new homepage. Dirty but effective.

Upvotes: 0

Jon Lin
Jon Lin

Reputation: 143896

This isn't going to be as simple as a rewrite rule. This is because wordpress has its own routing and expects to see path information from either the REQUEST_URI or path info. That means if you try to rewrite, the path info isn't going to be right.

The way I've set this up in the past is create an index.php file in your document root and add this in your htaccess file:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

And in the index.php:

<?php
define('WP_USE_THEMES', true);
require('./wordpress/calientes/wp-blog-header.php');
?>

Upvotes: 0

Related Questions