How to convert a page address into a sub-domain url?

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.x extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
mainspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Fri Dec 30, 2011 9:52 am

How to convert a page address into a sub-domain url?

Post by mainspring » Wed Jul 18, 2018 7:36 pm

Hi guys I am trying to make this work but still no results. I have my blog at mypage.com/blog so I used
RewriteRule ^/blog/(.*)$ http://blog.mypage.com/$1 [R=301,L]
but nothing actually happened. Do you have any suggestions?
thank you
Last edited by imanickam on Thu Jul 19, 2018 3:14 am, edited 1 time in total.
Reason: Split from the topic f=712&t=960073. In the future, for your issues, please create separate topics. Even though the symptom of the problem may be the same, the cause could be different as the environments are different.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44093
Joined: Sat Apr 05, 2008 9:58 pm

Re: How to convert a page address into a sub-domain url?

Post by Webdongle » Thu Jul 19, 2018 8:00 am

No need to make a rewrite rule. Create a menu item of type eternal url.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

mainspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Fri Dec 30, 2011 9:52 am

Re: How to convert a page address into a sub-domain url?

Post by mainspring » Sat Jul 21, 2018 8:39 am

well if I create menu item with this link blog.mypage.com then nothing will happen as there is nothing in the subdomain folder. or did I missed something?

thank you

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44093
Joined: Sat Apr 05, 2008 9:58 pm

Re: How to convert a page address into a sub-domain url?

Post by Webdongle » Sat Jul 21, 2018 10:25 am

mainspring wrote:well if I create menu item with this link blog.mypage.com then nothing will happen as there is nothing in the subdomain folder. or did I missed something?

thank you
why nothing in it when you want to redirect to it?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

mainspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Fri Dec 30, 2011 9:52 am

Re: How to convert a page address into a sub-domain url?

Post by mainspring » Sat Jul 21, 2018 10:46 am

i need all articles in blog to look like this:
blog.mysite.com/article1
instead of
www.mysite.com/blog/article1

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30936
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: How to convert a page address into a sub-domain url?

Post by Per Yngve Berg » Sat Jul 21, 2018 11:54 am


User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44093
Joined: Sat Apr 05, 2008 9:58 pm

Re: How to convert a page address into a sub-domain url?

Post by Webdongle » Sat Jul 21, 2018 12:49 pm

If (on www. site.com) you create a menu item type external url ... then the link will redirect site.com/blog to blog.site.com. Whichever way you redirect you will need something in blog.site.com
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

mainspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Fri Dec 30, 2011 9:52 am

Re: How to convert a page address into a sub-domain url?

Post by mainspring » Sun Jul 22, 2018 1:22 pm

I need only one installation of joomla so I though I can do this with .htaccess where I would redirect all links to mysite.com/blog to blog.mysite.com anyone knows how to do it?

thank you

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30936
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: How to convert a page address into a sub-domain url?

Post by Per Yngve Berg » Sun Jul 22, 2018 3:23 pm

mainspring wrote:I need only one installation of joomla so I though I can do this with .htaccess where I would redirect all links to mysite.com/blog to blog.mysite.com anyone knows how to do it?
It's not supported by Joomla. You need the extension a linked to in my previous post.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44093
Joined: Sat Apr 05, 2008 9:58 pm

Re: How to convert a page address into a sub-domain url?

Post by Webdongle » Sun Jul 22, 2018 3:44 pm

mainspring wrote:I need only one installation of joomla so I though I can do this with .htaccess where I would redirect all links to mysite.com/blog to blog.mysite.com anyone knows how to do it?

thank you
Whatever method you use to redirect mysite.com/blog to blog.mysite.com then you need content in blog.mysite.com. That is because once the browser is redirected to blog.mysite.com it will try to read blog.mysite.com.

I suspect that you want the url to say blog.mysite.com but still be reading mysite.com/blog. If that is the case then:
At the top of the .htaccess of mysite.com have

Code: Select all

# This allows you to redirect mysite.com/blog to blog.mysite.com
Redirect /blog/* http://blog.mysite.com
In the subdomain blog.mysite.com have index.html with

Code: Select all

 <iframe src="mysite.com/blog"></iframe> 
Then if you have 'Blog' as a top level menu item that links to your Joomla blog (and your site does not append html) ... then when it is clicked the browser will redirect to blog.mysite.com but show mysite.com/blog

That will allow the url to be blog.mysite.com without you moving your blog from inside Joomla.

You will need to try it to see if you can return to Home (or other page in mysite.com) to see if mysite.com is shown in the url. (It should do but if it doesn't then you might need a .htaccess in blog.mysite.com to redirect everything except /blog back to myblog.com.)

Note that the folder for the subdomain (blog.mysite.com) needs to be:
1. In the same folder as your Joomla's configuration.php
and
2. The folder that the subdomain (blog.mysite.com) points to should not be called 'blog'.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
digitalkube
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Sat Aug 11, 2018 6:32 pm
Location: India
Contact:

Re: How to convert a page address into a sub-domain url?

Post by digitalkube » Sun Aug 12, 2018 5:31 am

This redirect rule should work properly:

Code: Select all

RewriteRule ^/blog/(.*)$ http://blog.mypage.com/$1 [R=301,L]
Flush cache after creating the rule and then try to visit the URL.

priya111
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Aug 10, 2018 11:51 am

Re: How to convert a page address into a sub-domain url?

Post by priya111 » Fri Aug 24, 2018 11:16 am

In that case, Joomla Redirection Components allow you to easily convert a page address into a sub-domain URL. You can also repair all broken links.


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”