webgyrl Posted March 24, 2010 Posted March 24, 2010 Ok, here's the scenario: I want to create a redirect link and make it simple so people can remember it. Something like http://www.natalie-brown.com/challenge I want to redirect this link to another site. How can I do this in my .htaccesss file? Normally for a redirect I would put something like: redirect 301 /list.htm http://www.natalie-brown.com/interact/mailing-list.html But I usually have to have the .htm or .html I want to make it so that I don't have to have that as a part of the link that is being redirected. Is this possible and how can I do it? Thanks! Nat Quote
OJB Posted March 24, 2010 Posted March 24, 2010 Sounds like you want a rewrite as opposed to a redirect. try something like this: > RewriteEngine on RewriteRule ^challenge your-actual-page.html [QSA,L] This will rewrite challenge to your-actual-page.html but 'challenge' will remain in the address bar. Quote
boxturt Posted March 25, 2010 Posted March 25, 2010 That works very well! I've been wanting to do that for a while now. Thanks for this Quote
webgyrl Posted March 25, 2010 Author Posted March 25, 2010 (edited) Sounds like you want a rewrite as opposed to a redirect. try something like this: > RewriteEngine on RewriteRule ^challenge your-actual-page.html [QSA,L] This will rewrite challenge to your-actual-page.html but 'challenge' will remain in the address bar. AWESOME! Works like a charm. Thank ye kind sir! @BOXTURT... it's been a while! How ya doin? Edited March 25, 2010 by webgyrl Quote
webgyrl Posted March 27, 2010 Author Posted March 27, 2010 (edited) Sounds like you want a rewrite as opposed to a redirect. try something like this: > RewriteEngine on RewriteRule ^challenge your-actual-page.html [QSA,L] This will rewrite challenge to your-actual-page.html but 'challenge' will remain in the address bar. Uh-oh, not sure what happened, but when I ported my new site to root, this redirect stopped working. The rule I have in htaccess is: ## Begin Rewrite Section RewriteEngine on RewriteRule ^challenge http://nataliebrown.ning.com/page/90-day-challenge [QSA,L] ## End Rewrite Section I can send htaccess if you PM me your email addy. Some of the file is new as I switched from J1 to J1.5 Thanks for any help you can give! Nat Edited March 27, 2010 by webgyrl Quote
webgyrl Posted March 27, 2010 Author Posted March 27, 2010 I'm fine Natalie, thanks for asking! Glad to hear! Quote
webgyrl Posted March 27, 2010 Author Posted March 27, 2010 (edited) Ok for now I found a way around it by creating a challenge folder with an index.html that has a meta refresh. Hope I can find out why the redirect stopped working! Edited March 27, 2010 by webgyrl Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.