简体   繁体   中英

use one domain to two different websites

I need .htaccess file for a problem. 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. Can anyone help me Currently i am using .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.
  • 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.

Now you can browse your site directly to the WordPress and "YourSite.com/login" as Laravel Login page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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