juliereader Posted July 17, 2016 Share Posted July 17, 2016 Hi there, I have laravel based website and if you visit it, it shows you clean urls as followsdomain.com/site/myfoldernamehowever the same page can be also accessed via the following urldomain.com/public/index.php/site/myfoldernnameI need to 301 redirectdomain.com/public/index.php/site/myfoldernnametodomainl.com/site/myfoldernamemy current htaccess in root (public_html) #AddHandler application/x-httpd-php55 .php <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} !^public RewriteRule ^(.*)$ public/$1 [L] </IfModule> my current htaccess in laravel public folder <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> <FilesMatch "^.*?style.*?$"> SetHandler php5-script </FilesMatch> Quote Link to comment https://forums.phpfreaks.com/topic/301493-301-redirect-to-non-publicindexphp-url-laravel/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.