I think you are misunderstanding the purpose of .htaccess, but I cannot be sure without a more concrete explaination of what you are trying to do. If you are just trying to shorten your URLs I don't recommend using redirects for this. You could accomplish this with a simple rewrite rule, but having all of your internal links converted to external links which get redirected to an internal page seems like a bad approach to me.
If your domain name is seriously too long to type out in your code, you can do something like this:
PHP Code:
<a href="<?php $_SERVER['HTTP_HOST']; ?>/index.php">My Link</a>
or
PHP Code:
<?php
$url = $_SERVER['HTTP_HOST'];
?>
<a href="<?php echo $url; ?>/index.php">My Link</a>
Not an ideal situation, but I really advise against using another domain and redirection.
Last edited by NullPointer; 05-19-2009 at 05:24 PM..
|