Dr Adil Ramzan
asked 9 years ago

Hello you had suggested me changes to htaccess file.
i have made the suggested changes but they don’t work. what to do next please help.
My htaccess looks like this.

RewriteOptions inherit

Always use www in the domain

Replace ‘example.com’ with your domain name

RewriteEngine on
RewriteCond %{HTTP_HOST} ^([a-z.]+)?askwebdr.com$ [NC]
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule .? http://www.%1askwebdr.com%{REQUEST_URI} [R=301,L]

BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

END WordPress

how to make this redirect 301.

http://www.askwebdr.com/dwqa-answer/answer-for-what-is-propranolol-why-it-is-used/

Best regards.

1 Answers
DominicStaff
answered 9 years ago

You can try the following code:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /special/service
RewriteRule ^(.+)$  http://www.%1askwebdr.com%{REQUEST_URI} [R=301,NC]

BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

END WordPress

Hope this helps !

dradil
replied 9 years ago

should i change the my whole of htaccess file to this. replace all text to this?

dominic Staff
replied 9 years ago

At the moment, i’m not sure this solution possible compatible to change 302 redirect to 301. Because, currently, our plugin does not support to change it. In this case, you can try copy the .htaccess` file and paste into backup folder and then replace all the codes line in this file with new codes that I have provided then check it. Hope you understand what I mean.
Hope this helps !

dradil
replied 9 years ago

Thank you Dominic for your reply, i really appreciate your concern, but unfortunately, when i changed my htaccess file, my website failed to load, gave an internal error and 500 error. :/

dominic Staff
replied 9 years ago

I see, please revert to old code in the .htaccess file. I think our theme not support to change it. I sent and notified our technical theme about it.
Regards,

Powered by DW Question & Answer Pro