I have rebuild a site. The old site was WordPress and new site is normal php site with same amount of pages.
I do not want to lose the outside plus google links to this pages and need to do a redirect in .htaccess
I know how to do this with normal links e.g. www.domain1.com/guesthouse.html to www.domain2.com/guesthouse.php
I do not understand the wordpress link with no “.php or .html” at the end of the link.
The old link is www.doamin.com/guesthouse/ (only this without .html or .php)
New link must be www.domain.com/gusethouse.php
The WordPress .htaccess file looks like this
`# 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`
Can I delete the above code and replace with
`Redirect 301 /guesthouse/ http://www.domain.com/guesthouse.php`
or must I add it to the existing .htaccess code.
Do not know how to do it right, please help.
Thank you.
The
.htaccess
file will execute prior to your PHP interpreting engine running. This means that you’re higher in the execution chain than the WordPress software.If you’re not going to use your WordPress website anymore, then there’s no reason to send requests to it!
Instead, just simply remove all of that code, and rewrite the URL’s accordingly.