301 redirect

info26622
29 Posts
info26622 posted this 06 July 2020
Ask a Question

I am almost ready to upload my new site to the server. The previous site was an .htm one, new one .html. Some of the pages I would like to direct to new pages, e.g. example.htm to example1.html, the remaining pages I want to redirect all from .htm to .html.

Can I in .htaccess first redirect the individual pages, and later in the .htaccess use a code like this, RewriteRule (.*).htm $1.html [PT,L] ? Or would the latter code interfere with the individual redirects?

Thanks,
Steven

I am almost ready to upload my new site to the server. The previous site was an .htm one, new one .html. Some of the pages I would like to direct to new pages, e.g. example.htm to example1.html, the remaining pages I want to redirect all from .htm to .html. Can I in .htaccess first redirect the individual pages, and later in the .htaccess use a code like this, RewriteRule (.*).htm $1.html [PT,L] ? Or would the latter code interfere with the individual redirects? Thanks, Steven
Vote to pay developers attention to this features or issue.
3 Replies
Order By: Standard | Newest
Sam B
61 Posts
Sam B posted this 08 July 2020

Hey, it’s quite easy. After you upload the website just access the .htaccess file and use this link to generate 301 redirect. Paste it and save it. It’s a breeze.

https://www.aleydasolis.com/htaccess-redirects-generator/page-to-page/

Hey, it’s quite easy. After you upload the website just access the .htaccess file and use this link to generate 301 redirect. Paste it and save it. It’s a breeze. https://www.aleydasolis.com/htaccess-redirects-generator/page-to-page/
info26622
29 Posts
info26622 posted this 08 July 2020

Thanks for your answer. Unfortunately it does not answer my question, but may be useful in the future. It is not the creation of the .htaccess file that I have a question about, I have that file ready. It is this question I would like answered, "Can I in .htaccess first redirect the individual pages, and later in the .htaccess use a code like this, RewriteRule (.*).htm $1.html [PT,L] ? Or would the latter code interfere with the individual redirects?".

But again thanks,
Steven

Thanks for your answer. Unfortunately it does not answer my question, but may be useful in the future. It is not the creation of the .htaccess file that I have a question about, I have that file ready. It is this question I would like answered, "Can I in .htaccess first redirect the individual pages, and later in the .htaccess use a code like this, RewriteRule (.*).htm $1.html [PT,L] ? Or would the latter code interfere with the individual redirects?". But again thanks, Steven
info26622
29 Posts
info26622 posted this 08 July 2020

I can confirm first redirect individual pages, followed by that specific rewrite rule works as intended.

I can confirm first redirect individual pages, followed by that specific rewrite rule works as intended.
You must log in or register to leave comments