简体   繁体   English

使用一个域访问两个不同的网站

[英]use one domain to two different websites

I need .htaccess file for a problem.我需要 .htaccess 文件来解决问题。 I have two websites one is wordpress and one is in laravel i just want if i write simple domain example.com it will redirect to wordpress but if i write example.com/login it should redirect to laravel site.我有两个网站,一个是 wordpress,一个是 laravel,如果我写简单的域 example.com,它会重定向到 wordpress,但如果我写 example.com/login,它应该重定向到 laravel 站点。 Can anyone help me Currently i am using .htacess谁能帮助我目前我正在使用.htacess

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /portfolio/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

One thing can be done in an easy way.一件事可以以一种简单的方式完成。

  • just create a new directory as "login" in your cPanel where the WordPress site has been hosted.只需在托管 WordPress 站点的 cPanel 中创建一个新目录作为“登录”。
  • Now upload your Laravel site to the "login" folder and make required changes in your Routes in file, so that the Laravel Login Page appear as default Route of the site.现在将您的 Laravel 站点上传到“login”文件夹并在文件中的 Routes 中进行必要的更改,以便 Laravel 登录页面显示为站点的默认路由。

Now you can browse your site directly to the WordPress and "YourSite.com/login" as Laravel Login page.现在你可以直接浏览你的站点到 WordPress 和“YourSite.com/login”作为 Laravel 登录页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM