Forum Moderators: phranque
[profile.domain.com...]
The rule works and sends them to
[domain.com...]
Here is the rule
RewriteEngine On
RewriteRule ^(.*)$ [domain.com...] [L]
Now It will not keep the [profile.domain.com...] in the browser window like i want.. is there a way to stop this re-direction with the browser?
Welcome to WebmasterWorld!
By specifying a canonical URL in your substitution, you have forced an external redirect. Since you did not specify which type you wanted by using the [R] flag, mod_rewrite will default to a 302 redirect.
The solution is either simple or very simple, depending on whether this code is for use in .htaccess or in httpd.conf. Either way, you use a path relative to the server root rather than a canonical URL, in order to specify an internal rewrite rather than an external redirect:
.htaccess:
# Prevent .htaccess recursion if index.php is requested
RewriteCond $1 !^index\.php$
# else do the rewrite
RewriteRule (.*) /index.php?option=profile&user=$1 [L]
RewriteRule ^/(.*) /index.php?option=profile&user=$1 [L]
RewriteRule ^/(.*) [theblogring.com...] [L]
I get a 404.. now i can't do /index.php.. since its on a complete different subdomain
it tries to load profile.domain.dom/index.php
Furthermore, it is possible but unlikely that adding the Options directive will cause a 500-Server Error. If this happens, delete that directive. But either the FollowSymLinks or SymLinksIfOwnerMatch option must be set in your httpd.conf or .htaccess file in order to enable mod_rewrite.
Options +FollowSymLinks
RewriteEngine on
#
# Prevent .htaccess recursion if index.php is requested
RewriteCond $1 !^index\.php$
# else do the rewrite
RewriteRule (.*) /index.php?option=profile&user=$1 [L]
Jim