Forum Moderators: phranque

Message Too Old, No Replies

rewrite but dont want to affect domain or subfolder

         

ianternet

11:49 pm on Jun 26, 2008 (gmt 0)

10+ Year Member



ok so this is what I want to do

> redirect domain.com to domain.com/start

but I do not want to affect

> domain.com dynamic php or links (example.com/index.php?#*$!xx or example.com/?#*$!#*$!)
> or do I want to affect example.com/start links or folders

this is what I have and had and joined...

RewriteCond %{HTTP_HOST} www.example.com
RewriteCond %{REQUEST_URI} !^/start/
RewriteCond %{REQUEST_URI} \..+$
RewriteRule ^(.*)$ start/$1 [L]

RewriteCond %{HTTP_HOST} www.example.com
RewriteCond %{REQUEST_URI} !^/start/
RewriteRule ^(.*)$ start/$1/ [L]

but...

going to example.com/index.php?signup will still redirect to example.com/start

how can I redirect JUST the example.com without affecting links or php dynamics? BUT I want to be able to link from example.com and example.com/start

thanks

[edited by: jdMorgan at 7:18 pm (utc) on June 28, 2008]
[edit reason] example.com [/edit]

g1smd

12:18 am on Jun 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Redirecting the root of a domain to an inner URL is most usually a bad idea.

The most important URL on your site is www.domain.com/. I would not redirect it.

I would use a rewrite to pull content from the inner filepath without exposing what that filepath actually is.

That's easy to do. Test for the URL path to be empty. Note that RewriteRule does not see the leading "/" of the requested URL, and for root the requested URL is only "/".

ianternet

12:35 am on Jun 27, 2008 (gmt 0)

10+ Year Member



hmmmm

but domain.com is a signup process (affiliate signup and manager site)
and domain.com/start is the blog portion.

I messed up and should have done blog first then put the affilaite site in a subdomain - and now I can not put it in a folder because i have too many affiliates already and do not want to mess anyones urls

tryint o see if I ca still use both sites without affecting dynamic phph - just need the original homepage domain.com to redirect to domain.com/start without affecting domain.com/index.php?somethinghere or domain.com/?somethinghere

dont know any other htaccess rule

jdMorgan

7:24 pm on Jun 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



None of the code posted above does what you say you want. Try:

# If query string is blank
RewriteCond %{QUERY_STRING} ^$
# redirect domain root page requests to /start/
RewriteRule ^$ http://www.example.com/start/ [R=301,L]

Jim