i have some question for you, pardon me before. I have some trouble when i want to redirect my website to another location. A url i have trying is like this :
http://localhost/mywebsite/public/example.html => Default URL
I want to redirect my Default url to here:
http://localhost/mywebsite/example.html => What i want
My .htaccess code is :
Redirect 301 public /
im using laravel framework
Put your .htaccess file in "public" folder:
RewriteEngine on
RewriteRule (.*)$ /mywebsite/$1 [R=301,L]
If you want the redirection to be transparent i.e. /public
remains hidden in the URL, don't do a 301 as it does an external redirect. Use the following RedirectRule
instead.
RewriteCond %{REQUEST_URI} !/public/ [NC]
RedirectRule ^mywebsite/(.*)$ mywebsite/public/$1 [NC,L]
This would serve /mywebsite/page.html
silently from /mywebsite/public/page.html
.