Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...it was ingeniously designed and all those clicks were for my own good... and that was even before I got my speedy and useful answer to my tekkie question that I eventually posted..."

Geography

Where in the world do Tek-Tips members come from?

How can I get a dynamic url will redirect to Homepage

tondar1 (Programmer)
7 May 12 7:55
How can I get a dynamic url will redirect to Homepage
it is on an Apache server
example:
Code:

http://mysite/component/content/?view=featured

redirect to:
Code:

http://mysite

I found this code, but does not respond to me ،where this code is wrong?
orginal code
Code:
Redirecting a page without an ID:
Old URL: http://www.example.com/?/page/55c9/
New URL: http://www.example.com/newpage.php/page/55c9/
RewriteCond %{QUERY_STRING} ^/page/55c9/$
RewriteRule ^$ http://www.example.com/newpage.php/page/55c9/? [R=301,L]

my code:
Code:
Redirecting a page without an ID:
Old URL: http://www.example.com/component/content/?view=featured
New URL: http://www.example.com
RewriteCond %{QUERY_STRING} ^view=featured$
RewriteRule ^$ http://www.example.com? [R=301,L]
ChrisHirst (IS/IT--Management)
7 May 12 9:06

CODE

RewriteEngine  on

RewriteRule ^http://mysite.tld$ http://mysite.tld/component/content/?view=featured

or

CODE

RewriteEngine on

Redirect 301 /http://mysite.tld/component/content/?view=featured http://mysite.tld

OR

CODE

RewriteEngine on

Redirect 301 /component/content/?view=featured http://mysite.tld
 

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

tondar1 (Programmer)
7 May 12 9:58
Hi Thanks for the answer
but
This code does not work. Does not do redirects
ChrisHirst (IS/IT--Management)
7 May 12 13:12
And this site is definitely being served out from Apache running on Linux/Unix?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

tondar1 (Programmer)
7 May 12 14:20
Linux

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close