Permalink for Homepage - wordpress

I have a simple wordpress question. Currently I have a site with a static home page, when I visit my site examplesite.com the URL reads what it should which is examplesite.com, would it be possible to give this static home page a permalink so that when I load the site it automatically turns to examplesite.com/customlink. What I am saying is I still want the same home page and the same URL to reach it, I just want a specific permalink to appear. I can edit permalinks for all other pages but since this is my homepage I see no option to do it automatically in wordpress.

Inside settings you can set static pages as default.

For this you'll need .htaccess, e.g.
RewriteEngine On
RewriteBase /
RewriteRule ^$ page-you-want [L,R=301]
So any requests to root will get moved to the permalink you want. You don't need to set your home page to a static page/front page.

Related

htaccess, rewriteurl to page of WordPress site in sub-folder

Here's the scenario, I have a single server and two WordPress sites living in their respective sub-folders:
public_html/site_one/
public_html/site_two/
These sites display as follows:
www.site.com/site_one/
www.site.com/site_two/
The second of those sites has a splash page / landing page:
www.site.com/site_two/landing-page/
...that needs to display in the root of the site:
www.site.com/
I'm aware that there are better ways of achieving this, but I'm restricted to working with how it's currently set up.
Initially I thought I would be able to set up a .htaccess file in the root that rewrites access to the root of the site to display the landing page from site_two, but this isn't working as expected. This is the .htaccess file from the root of the server:
RewriteRule ^$ subfolder/page-slug [L]
This redirects to the site's front page. If I replace page-slug with ?p=1234 then it displays as the correct page but also seems to redirect to the landing page's full URL.
Is there any means of achieving what I'm after?
To clarify:
User visits site.com
URL displays as site.com
Page displayed is site.com/site_two/landing-page/
I've managed to have this behaviour working when not linking to a WordPress page (using a test index.php in 'test-subfolder') but WordPress and its own .htaccess file seems to be confusing matters.
Any help would be appreciated. Is there a way of excluding the landing page from the WP .htaccess file and what is it about the WP .htaccess file that's stopping the page being displayed at the root of the site?

Wordpress Multisite url remapping

I'm currently using a complex multisite setup. I have the site as the landing page/blog and another site for the main functionality. The subdomain of the main site is set to /dashboard/ so every other page that loads after has the dashboard slug in it. IE www.name.com/dashboard/post-a-project.
Is there was a way to make the website appear as www.name.com/post-a-project while not interfering with the landing page site? This is mostly for aesthetic purposes.
Try and use this in your .htaccess file:
RewriteEngine On
RewriteRule ^dashboard/(.*)$ /$1 [L,R=302]
I've set it to a temporary redirect using R=302. If this works for you then change it to R=301 to make it a permanent redirect.
Make sure you clear your cache before testing this.

htaccess Mod rewrite and permalink

I have a WordPress website where the requirement is exactly like below:
WordPress site should be installed on: http://www.mydomain.com/wp/ |
Website homepage should be access from: http://www.mydomain.com/ if someone visits http://www.mydomain.com/wp/ he should be redirect to http://www.mydomain.com/
But when accessing all other inner pages, visitors should follow the URL format:
http://www.mydomain.com/wp/test-page1
http://www.mydomain.com/wp/test-page1
This means I need the main website access from main domain directly but all other inner pages should open under sub-directory as mentioned above.
how can I do that with .htaccess? Thanks
Please look into this website about htaccess redirects: http://htaccess.wordpress.com/2008/09/15/redirecting-urls-in-htaccess/
Aside from that, you will want to have your RewriteBase to be / and not wp so that the user doesn't go to wp subfolder automatically.

Forwarding homepage to landing page using htaccess

I have a Wordpress site (eg. www.domain.com) that lands on the homepage. I want to change this, so it actually lands on an interior page (eg. www.domain.com/landing/). I don't want to do a standard redirect, as I still want to allow access to the homepage. I just want to change the initial landing page.
I'm assuming it's a matter of updating the ".htaccess" file, but I just want to find a solution that will still allow me to access the homepage of the site, once I've landed on the landing page.
You can do this in the wordpress dashboard/customise your site. Set your static front page to the new landing page.
Try checking the referer to make sure it's either someone who typed the URL in the address bar or clicking a link elsewhere:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^https?://(www\.)?domain\.com [NC]
RewriteRule ^$ /landing/ [L,R]
You'd want this above your wordpress rules.

Wordpress Blog URL

For some reason my blog posts are creating their own URL's.
Blog is on www.website.com/blog/ but when I make a new post, the new post URL is www.website.com/new-post-url/.
What I want is for the blog posts URL to be www.website.com/blog/new-post-url/ as their URL.
I use All in One SEO as my SEO plugin (if that matters).
You should check your blog setting.
login as administrator and go Settings >> General Settings
check here Site Address (URL). This should be http://www.website.com/blog
Hope this is helpful.
all the best ;)
#user1667462
Have you checked your .htaccess file?
Because you when you're having /blog kind of redirect to your WordPress Blog then you must have to add below code in your .htaccess file
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?website.com$
RewriteRule ^(/)?$ blog [L]
Go to Settings -> PermaLinks from Dashboard and select Custom Structure
give /blog/%postname%/
Check your blog by going to any post/page.
Log into your Wordpress admin panel and check to ensure that permalinks are set to the appropriate settings. Also check to make sure that your theme is not overriding the settings you might have chosen. Some themes for example can explicitly request you set a blog page for the blog posting which can interfere with what you assume to be happening.
Your go to admin page and click setting page, change the url types.

Resources