I want to rename my single url to subdomain url - .htaccess

I want rename my URL: https://www.example.com/onlysinglepage URL to https://sub.example.com/onlysinglepage
In this rename URL content comes from the maindomain just display on the subdomain. Nothing on the subdomain.
This is possible via .htaccess file?

Related

.httaccess 301 redirect subdomain with path wildcards

I need to 301 redirect URL's I was using on my old website/platform to my new website on Shopify.
Old url structure:
https://shop.olddomain.com/path/name-of-page
What I would like to have is a wildcard for http/https, because the platform changed my website from insecure to secure back when Google started ranking based on that.
I would also need a wildcard for /path/name-of-page, because I have hundreds of URL's with that structure and I'm not trying to map each of those URL's to the new URL's. Basically, my goal is to make sure those old URL's don't go to a dead end 404, and are redirected to the new website homepage.
So http/https://shop.olddomain.com/* should redirect to https://newdomain.com
In your .htaccess for shop.olddomain.com place
Redirect 301 /shopoldpath https://newdomain.com

Rename page A URL with a subdomain (Redirect to new url but keep content from old url)

I have a landing page for mobile: abc.com/landing-page-mobile
I want to rename the URL above with my subdomain: m.abc.com
How can I do that with htaccesss file?
My idea is that redirect abc.com/landing-page-mobile to m.abc.com but KEEP the landing page content.
I have searched a lot of results but they are like redirection from abc.com/landing-page-mobile to m.abc.com and the content is from m.abc.com

how to make clean url using htaccess for subdomain

for e.g. my domain is www.examples.com and subdomain is test2.examples.com
I am using url variable to link pages.
e.g.test2.examples.com/index.php?page=registers
but I want clean url like
test2.examples.com/page/registers
How can I do this using HTACCESS file.
can I use HTACCESS for subdomain or it will not allow
You are looking for URL Rewriting, it will answer all your needs., see this URL Rewriting Guide

htaccess redirect entire site to one directory

What I want to do is very simple but cant find the unique solution anywhere. I want to redirect all files and folders in the site to a single directory.
Redirect domain.com/ and domain.com/* to domain.com/folder/
Basically all strings typed into the url is redirected to the subfolder hiding the entire site from the public and redirecting to a splash page with the condition of ![ip address]

Dynamic subdomain redirection to URL variable

I am trying to redirect any subdomain of my website to a page by using the subdomain's name as a variable but without the URL to actually change.
e.g.
http://SUBDOMAIN-NAME.website.com
to poing to:
http://www.website.com/view/SUBDOMAIN-NAME
but with the URL staying as
https://soundcloud.com/bugprentice/im-so-tired
I am on an APACHE server and I would like to use .htaccess rules

Resources