Link to home
Start Free TrialLog in
Avatar of yarekGmail
yarekGmail

asked on

apache .htaccess

Hello experts
I have a website based on wordpressMU.
when someone creates his blogs, the url is
www.mysite.com/blog/HISBLOG

which is a very long URL
Is there a a way to make it short ?
like:
www.mysite.com/HISBLOG
or
HISBLOG.mysite.com

I guess some .htaccess ?
 
Avatar of V4nP3rs13
V4nP3rs13
Flag of Bosnia and Herzegovina image

yes... you can do it with htaccess. First, mod_rewrite must be enabled/installed (you can check it with phpinfo() function)... then write tihs code in htaccess

RewriteEngine on
RewriteRule HISBLOG blog/HISBLOG

I hope this helps
Avatar of yarekGmail
yarekGmail

ASKER

Hisblog Is variable !
whatt?? I don't understand what you want to do... i gave you the code for changing blog/HISBLOG into HISBLOG... what you want? You must precisely explain us what do you want to change with htaccess
Hisblog Is variable !
Avatar of arober11
Hi

The following may get you most of the way there:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f     # Not a physical file
RewriteCond %{REQUEST_FILENAME} !-d    # Not a physical directory
RewriteCond  %{REQUEST_URI}   ^/blog/    # Not for an alias, guessing blog is an alias
RewriteRule ^(.*)  /blog/$1    [L]

If you want the URL, in the browser bar, to change the replace the [L] with a [R=301,L]
ASKER CERTIFIED SOLUTION
Avatar of bplant
bplant

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial