Jump to content

mod rewrite & create subdomain ?


ahadsalim

Recommended Posts

Hello
I have a website like weblog that user can register and write their Post and publish them !
but i have some problem to rewrite url !
i want when user type : something.mysite.com
redirect to mysite.com/blogindex.php?u=something
I install wild card and it redirect all addresses & i use this in .htaccess
[code]RewriteEngine On
# Extract the subdomain part of domain.com
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC]
# Check that the subdomain part is not www and ftp and mail
RewriteCond %1 !^(www|ftp|mail)$ [NC]
# Redirect all requests to a php script passing as argument the subdomain
RewriteRule ^.*$ http://www.domain.com/blogindex.php?u=%1 [R,L][/code]
but when i type the URL ,redirected in address bar too, i want users don't underestand this !
and the next is ,
when i type somthing.mysite.com/archive.php?70  i want redirect to mysite.com/blogarcive.php?u=something&postid=70



Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.