Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirect 301
#1
Exclamation 
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 ?
Reply
#2
Did you enable fancyurls and set your permalink to %parent%/%slug%.html already or something similar.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
(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]
Reply
#4
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.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
(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.
Reply




Users browsing this thread: 1 Guest(s)