Support the ongoing development of Laravel.io →
Installation Configuration
Last updated 2 years ago.
0

Edit: Oh, I understand the problem better now, well if you are using an apache server to host your applications you can always use the Alias feature, you just need to enable the mod_alias module in your apache configuration. Here is more info about the Alias feature.

http://httpd.apache.org/docs/2.2/mod/mod_alias.html
http://httpd.apache.org/docs/2.2/urlmapping.html

And a nice tutorial to get you started:

http://code.tutsplus.com/articles/apache-aliasing-and-redirection--net-28606

Well if you want to have cross website, account interaction you should map your laravel or wordpress app with one users, so everyone will be able to login on both sites,if you want more complex interaction with wp and laravel I think you can work something if you are good with db managment, other than that if you just want a link pointing to your blog then just create a link from your laravel to wp and vice-versa.

Last updated 2 years ago.
0

Thanks for the info. I will have a look into these :)

Last updated 2 years ago.
0

I found a way to make this work.

For reference I stated badly with the entire laravel install inside the public_html folder and was using a .htaccess to rewrite everything to laravel's public folder.

The new structure is having the laravel install in the root and putting the public folder contents into public_html and just updated the index.php and paths.php to suit.

I then altered the public .htaccess so as not to rewrite anything to /blog.

Infomation from http://stackoverflow.com/questions/19923091/avoid-public-folder-of-laravel-and-open-directly-the-root-in-web-server Is a good place to start then the .htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

	RewriteCond %{REQUEST_URI} !^/blog
	
    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
Last updated 2 years ago.
0

It looks like you're trying to store your blog outside the public directory. You don't really need to do anything like that.

Put "blog" folder in the "public" directory and use the default .htaccess file.

  # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

That block of code indicates that anything that is a valid file or a directory will not be redirected to the laravel router, so you can get rid of the routing code too!

TL;DR essentially undo everything you did and leave blog in the "public" (root) directory

Last updated 2 years ago.
0

hi, how did you login in wordpress. like if user is login into youwebsite and opens the blog he has to be login into wordpress from the same credential of laravel.please reply

0

webofaaron said:

I found a way to make this work.

For reference I stated badly with the entire laravel install inside the public_html folder and was using a .htaccess to rewrite everything to laravel's public folder.

The new structure is having the laravel install in the root and putting the public folder contents into public_html and just updated the index.php and paths.php to suit.

I then altered the public .htaccess so as not to rewrite anything to /blog.

Infomation from http://stackoverflow.com/questions/19923091/avoid-public-folder-of-laravel-and-open-directly-the-root-in-web-server Is a good place to start then the .htaccess

<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule>
   RewriteEngine On

  RewriteCond %{REQUEST_URI} !^/blog
  
   # Redirect Trailing Slashes...
   RewriteRule ^(.*)/$ /$1 [L,R=301]

   # Handle Front Controller...
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^ index.php [L]
</IfModule>

hi, how did you login in wordpress. like if user is login into youwebsite and opens the blog he has to be login into wordpress from the same credential of laravel.please reply

0

I am trying to setup wordpress with my laravel installation too.

I have simply put it under public but going to localhost/wordpress gives me the following error:

This webpage has a redirect loop

ReloadHide details
The webpage at http://localhost:8080/wordpress has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

Does .htaccess need to be touched ? I tried adding this to it:

RewriteCond %{REQUEST_URI} !^/blog

but still the error doesn't go away. Any ideas?

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

webofaaron webofaaron Joined 18 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.