Dynadot โ€” .com Registration $8.99

Mod_rewrite

Spaceship Spaceship
Watch

tm

Established Member
Impact
25
Hey,

I need some help with mod_rewrite.

What I'm trying to do, is:

a user can type in:
mydomain.net/domain.com
it then brings up the page:
mydomain.net/index.php?domain=domain.com

But I can't seem to do it without it messing up with index.php (thinks its a domain.com)

Can anybody help?

Here's the code i have atm:
Code:
RewriteEngine on
RewriteRule ^([^/]+)/$ index.php?domain=$1 [L]

No idea whether it's right or wrong.

Thanks,

tm
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Code:
RewriteEngine on
RewriteRule ^([_A-Za-z0-9-]+)/?$ index.php?domain=$1 [L]

try this!
 
0
•••
0
•••
hanz said:
Code:
RewriteEngine on
RewriteRule ^([_A-Za-z0-9-]+)/?$ index.php?domain=$1 [L]

try this!

Would this work for a domain with a . in it? like domain.com
 
0
•••
I would do this:
Code:
RewriteEngine on
RewriteRule ^([a-zA-Z0-9-]+).com$ index.php?domain=$1.com [NC,L]
RewriteRule ^([a-zA-Z0-9-]+).net$ index.php?domain=$1.net [NC,L]
RewriteRule ^([a-zA-Z0-9-]+).org$ index.php?domain=$1.org [NC,L]
RewriteRule ^([a-zA-Z0-9-]+).us$ index.php?domain=$1.us [NC,L]
RewriteRule ^([a-zA-Z0-9-]+).info$ index.php?domain=$1.info [NC,L]
RewriteRule ^([a-zA-Z0-9-]+).biz$ index.php?domain=$1.biz [NC,L]
...
 
1
•••
Thanks _Jim, I'll be using that for now :)
 
0
•••
Jim, what does [NC,L] do?

I usually just use [L] but I don't know what that means either. >_<
 
0
•••
1
•••
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back