Posts: 23
Threads: 13
Joined: Dec 2013
2015-05-08, 00:06:35
Hello,
Google indexed my website with all the URLs like index.php?id=my-url
I'd like to do a redirect 301 via htaccess for example.
For example :
http://www.mydomaine.fr/index.php?id=hello-my-friend
should do a 301 redirect to
http://www.mydomaine.fr/hello-my-friend.html
Can you help me please ?
Posts: 6,266
Threads: 181
Joined: Sep 2011
Did you enable fancyurls and set your permalink to %parent%/%slug%.html already or something similar.
Posts: 23
Threads: 13
Joined: Dec 2013
2015-05-08, 00:48:05
(This post was last modified: 2015-05-08, 00:50:33 by paul59.)
(2015-05-08, 00:12:02)shawn_a Wrote: Did you enable fancyurls and set your permalink to %parent%/%slug%.html already or something similar.
Yes i tried but nothing happened. And I don't think it do a 301 redirect. no ?
I tried to had this in the htaccess as well. But nothing works i don't understand
# Usually it RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+).html$ index.php?id=$1 [QSA,L]
Posts: 6,266
Threads: 181
Joined: Sep 2011
No but working fancy urls will fix your original indexing problem.
You would have to add your own redirect rules in htaccess
I think you can enable
define('GSCANONICAL', 1);
in gsconfig
But I am not entirely sure.
Posts: 23
Threads: 13
Joined: Dec 2013
(2015-05-08, 01:05:09)Yes it Words thanks ! :) shawn_a Wrote: No but working fancy urls will fix your original indexing problem.
You would have to add your own redirect rules in htaccess
I think you can enable
define('GSCANONICAL', 1);
in gsconfig
But I am not entirely sure.