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 ?
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 ?
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
ASKER
Hisblog Is variable !
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]
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
RewriteEngine on
RewriteRule HISBLOG blog/HISBLOG
I hope this helps