How to put RewriteRule create by Mime::add_redirect to top of .htaccess

haulpd

Active Member
May 20, 2011
31
1
58
How to change position of RewriteRule in .htaccess

I have call UAPI to redirect customer website if that matched my rules, but I have a problem that if in .htaccess my customer have rule with [L], my directive can not process.

How can i change position of directive block created by Mime:add_redirect to top of .htaccess

Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello,

Could you provide an example of what the .htaccess file looks like before adding the redirect?

Thank you.
 

haulpd

Active Member
May 20, 2011
31
1
58
Yes, it like that, just default .htaccess of Wordpress
do You have solution to add redirect rule to top of .htaccess or we need copy old .htaccess to .htaccess.current and write new .htaccess to hosting.

Thanks!
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello,

It's not possible to alter the position of the Mod_Rewrite rules added when setting up a new redirect through cPanel. You'd need to setup your custom script to add those custom rewrite rules back in the position you need them in. I encourage you to open a feature request if you'd like to see more functionality regarding how redirects are configured through cPanel:

Submit A Feature Request

Thank you.