0

I have developed new site but I'm like to mantain some page adreesses already indexed on google. Google had indexed in this way: mysite.com/test-page/ (with slash at the end)

I have addedd on htaccess this conditions to cut off php extension when browsing:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

Rewrite rule cute off .php extension from page:

mysite.com/test-page

For this i can't access page from google url

Exist a way to add redirect from: mysite.com/test-page/ to: mysite.com/test-page ??

4

1 回答 1

1
RewriteRule ^(.*)/?$ $1.php [L,NC]

This will see the slash in the incoming request, but will not pass it to the resultant file-name.

于 2013-03-31T04:42:03.593 回答