![]() |
I have a quick question for programmers or server admins
Let say I want to make a rule in htaccess that when a user types mydomain.com/xxxxxxx
it will redirect them to another site otherdomain.com/folder/xxxxxxx/folder... so basically its taking what they put after the url and inserting it in another url that it will redirect them to. what's the best way to go about this? thanks in advance :) |
Mod Rewrite FTW
icq: 33375924 I'll hook it up for you for a few bucks :thumbsup |
Redirect /folder http://www.example.com/newfolder
|
to clarify
the xxxxxxx = different each time (username) |
kuniiiiiiiiiiiiiiiiiiiiiii
|
|
He's not trying to do a regular redirect... he wants the the id in the url to carry over within the url it will be redirected to.
|
Quote:
|
Can be done with mod_rewrite exclusively.
|
maybe something like this?
Code:
Options +FollowSymLinks |
Quote:
This does not work if its something like domain.com/xx-xxxx-xxxxx ...we need it to work in both situations. |
Code:
RedirectMatch 301 ^/(.*)$ http://static.askapache.com/$1 http://www.google.com/cse/home?cx=00...%3Akk7rwc2gx0i :) |
Quote:
I got Fris's code to work by adding a - after the 9 in the rewrite rule... RewriteRule ^([a-z0-9-]+) do you know what line I should put if I want the regular typeins redirected to a whole other site such as just www.yahoo.com ? |
Quote:
Code:
RedirectMatch 301 ^/*$ http://www.yahoo.com/ |
Quote:
|
All times are GMT -7. The time now is 08:19 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc