0

I want to move all the URLs with this structure

domain.com/public/index.php/site/samepagename

to

domain.com/site/samepagename

can anyone help me with the .htaccess

this is not duplicate of my previous issue. This is new.

  • 2
    Possible duplicate of [Redirect URL to custom URL through .htaccess](http://stackoverflow.com/questions/9382686/redirect-url-to-custom-url-through-htaccess) – selva Jul 18 '16 at 10:00
  • its not same.. That was for my woocommerce wordpress site. – JulieReader Jul 18 '16 at 10:08

1 Answers1

0

You can create .htaccess file and and add the below lines:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^public/index.php/([a-zA-Z0-9-]+)$ site/$1

OR

Options +FollowSymlinks
RewriteEngine on
rewriterule ^public/index.php/samepagename(.*)$ http://domain.com/site/samepagename$1 [r=301,nc]

Please note that above is not tested. Please test it locally before you deployed to production environment.

Suresh Kamrushi
  • 15,627
  • 13
  • 75
  • 90
  • not working ..also i have updated the actual urls...there was a directory missing in old urls – JulieReader Jul 18 '16 at 09:42
  • does your server support mod_rewrite? – Suresh Kamrushi Jul 18 '16 at 09:48
  • 500 Internal Server Error Also this is a laravel website so i have two htaccess one in public folder and one in public_html folder... One more thing the url end like this mydomain.com/site/mypagename.com or .net or .xys etc etc – JulieReader Jul 18 '16 at 10:03