Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Mod_rewrite

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Code:
RewriteEngine on
RewriteRule ^([_A-Za-z0-9-]+)/?$ index.php?domain=$1 [L]

try this!
 
0
Close
0
Close
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
Close
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
Close
Thanks _Jim, I'll be using that for now :)
 
0
Close
Jim, what does [NC,L] do?

I usually just use [L] but I don't know what that means either. >_<
 
0
Close
1
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back