I converted my site to MODx and used a new naming convention for my URLs that went like:
http://www.site.com/alias
The old convention was:
http://www.site.com/page.htm
I wanted to add 301 redirects in my htaccess that redirect anyone pointing to the old pages to the new pages generated in MODx.
So in my .htaccess file, I place this type of directive for each of the pages:
redirect 301 /page.htm
http://www.site.com/page
However, when someone goes to
http://www.site.com/page.htm they get redirected to:
http://www.site.com/page?q=page.htm
I am not sure why the "?q=page.htm" is being included in the redirect URL. Is this something to do with having friendly URLs enabled? Any other suggestions?
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now. Every contribution helps.
-
☆ A M B ☆
- 24,524 Posts
If your old page names are the same as the "alias" you’ve assigned to the corresponding MODx documents, you don’t need to do that at all. Just in the Configuration, for Friendly URLs, set the suffix to be .htm. Then it will be using the same as you used to have.
Unfortunately, they are not the same. Any ideas on why it is injecting that extra part?
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now. Every contribution helps.
-
MODX Staff
- 10,725 Posts
Did you place the redirects before the rewrite rules? If so, you could alternatively try just using another redirect rule before the MODx one that simply removed the .htm and continued into the MODx rewrite rule.
I do have the redirects before the rewrite rules. I am not to advanced at .htaccess directives. Could you elaborate on how to place in the rewrite rule that would truncate:
http://www.site.com/page?q=page.htm
to
http://www.site.com/page
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now. Every contribution helps.