<![CDATA[ Simple 301 redirect question - My Forums]]> https://forums.modx.com/thread/?thread=16922 <![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question?page=2#dis-post-515182
I was redirecting old URLs to the new ones with:
RedirectPermanent /oldpage http://www.mydomain/newpage

and got the ?q=oldpage in all my URLs

The following code worked for me:
RewriteRule ^oldpage$	http://www.mydomain/newpage?	[L,NC,R=301]


The ? at the end of the newpage URL somehow prevents any further redirect.]]>
kilroy Nov 19, 2014, 03:28 AM https://forums.modx.com/thread/16922/simple-301-redirect-question?page=2#dis-post-515182
<![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question?page=2#dis-post-497151
Redirect 301 /texasroots https://www.example-site.com/index.php?id=260


I had been trying to put this in the .htaccess redirect, but it wasn't working:

Redirect 301 /texasroots https://www.example-site.com/texasroots.html


Once I changed the redirect to the MODX ID (instead of putting the .html URL alias in the redirect: texasroots.html), it then worked just fine.]]>
flinx777 May 06, 2014, 01:42 PM https://forums.modx.com/thread/16922/simple-301-redirect-question?page=2#dis-post-497151
<![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question?page=2#dis-post-91825 before the friendly URL redirect. I wouldn’t advise doing a 301 redirect to any page of the form index.php?q=123 because that creates duplicate content.]]> esnyder Jun 06, 2011, 05:57 PM https://forums.modx.com/thread/16922/simple-301-redirect-question?page=2#dis-post-91825 <![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question?page=2#dis-post-91824
old page: SomeCategory/foo.asp
new page: foo.html

RewriteRule ^SomeCategory/foo.asp$ http://www.mydomain.com/foo.html [R=301,L]

Hope this helps!]]>
mickmcl Jan 19, 2011, 10:30 AM https://forums.modx.com/thread/16922/simple-301-redirect-question?page=2#dis-post-91824
<![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91823 kurucu Sep 26, 2010, 03:53 PM https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91823 <![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91822 Everettg_99 May 06, 2009, 12:17 PM https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91822 <![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91821 RewriteRule old.html http://www.site.com/new.html [L,NC,R=301]
grin]]>
crossroadbg Apr 04, 2009, 08:52 PM https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91821
<![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91820
# MODx supports Friendly URLs via this .htaccess file. You must serve web
# pages via Apache with mod_rewrite to use this functionality, and you must
# change the file name from ht.access to .htaccess.
#
# Make sure RewriteBase points to the directory where you installed MODx.
# E.g., "/modx" if your installation is in a "modx" subdirectory. If you have
# problems with your .htaccess working at all, try un-commenting the first 
# line above the "RewriteEngine On" directive.
#
# You may choose to make your URLs non-case-sensitive by adding a NC directive
# to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]

#Options +FollowSymlinks
RewriteEngine On
RewriteRule ^body-form-female-f5.php$ /body-form-02.php [R=301] # 301 Redirect


#Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com 
#RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
#
# or for the opposite domain.com -> www.domain.com use the following
# >>> DO NOT USE BOTH THE ABOVE AND BELOW <<<
#
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.mannequinmarket\.com 
RewriteRule (.*) http://www.mannequinmarket.com/$1 [R=301,L]



# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
# https://www.domain.com when your cert only allows https://secure.domain.com
#RewriteCond %{SERVER_PORT} !^443
#RewriteRule (.*) https://example-domain-please-change.com.com/$1 [R=301,L]



# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]


# The Friendly URLs part with regard to Subdirectories
# If you have your MODx installed in a subfolder of your web space 
# (such as /modx/) then you need to use the following line:
# RewriteRule ^(.*)$ /~mm/index.php?q=$1 [L,QSA,NC]

# This might work
RedirectMatch 301 ^/~mm/$ http://www.mannequinmarket.com/



# Make sure .htc files are served with the proper MIME type, which is critical # for XP SP2. Un-comment if your host allows htaccess MIME type overrides.

#AddType text/x-component .htc



# If your server is not already configured as such, the following directive
# should be uncommented in order to set PHP's register_globals option to OFF.
# This closes a major security hole that is abused by most XSS (cross-site
# scripting) attacks. For more information: http://php.net/register_globals
#
# To verify that this option has been set to OFF, open the Manager and choose
# Reports -> System Info and then click the phpinfo() link. Do a Find on Page
# for "register_globals". The Local Value should be OFF. If the Master Value
# is OFF then you do not need this directive here.
#
# IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
#
# Your server does not allow PHP directives to be set via .htaccess. In that
# case you must make this change in your php.ini file instead. If you are
# using a commercial web host, contact the administrators for assistance in
# doing this. Not all servers allow local php.ini files, and they should
# include all PHP configurations (not just this one), or you will effectively
# reset everything to PHP defaults. Consult www.php.net for more detailed
# information about setting PHP directives.

#php_flag register_globals Off



# For servers that support output compression, you should pick up a bit of
# speed but un-commenting the following lines.

#php_flag zlib.output_compression On
#php_value zlib.output_compression_level 5



# The following directives stop screen flicker in IE on CSS rollovers. If
# needed, un-comment the following rules. When they're in place, you may have
# to do a force-refresh in order to see changes in your designs.

#ExpiresActive On
#ExpiresByType image/gif A2592000
#ExpiresByType image/jpeg A2592000
#ExpiresByType image/png A2592000
#BrowserMatch "MSIE" brokenvary=1
#BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
#BrowserMatch "Opera" !brokenvary
#SetEnvIf brokenvary 1 force-no-vary


Unfortunately, it still doesn’t work. What am I doing wrong?

Thanks,

RC]]>
RubenC Mar 07, 2009, 08:25 AM https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91820
<![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91819
Thank you for that link. I looked over that article and tried to implement the 301 redirect command it recommends, but it still doesn’t work. Where exactly should I place it?]]>
RubenC Mar 06, 2009, 12:42 PM https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91819
<![CDATA[Re: Simple 301 redirect question]]> https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91818 Something on the stackoverflow site that may be helpful:
http://stackoverflow.com/questions/286004/hidden-features-of-modrewrite
KP]]>
kp52 Mar 06, 2009, 11:01 AM https://forums.modx.com/thread/16922/simple-301-redirect-question#dis-post-91818