PDA

View Full Version : Noobie question on .htaccess RewriteRule



bethesda
03-02-2009, 10:22 AM
I have several 1.59 Joomla sites and the directory structure is like this:

/public_html/firstsite
/public_html/secondsite
etc.

Each site subdirectory has its own .htacess file. I've got Search Engine Friendly URLs and mod_rewrite both turned on.

I want to be able to do some very basic url rewriting so I started with something simple in /public_html/firstsite/.htaccess, below RewriteEngine On:

RewriteRule somepage someotherpage

This fails, and I've tried several variants, like this:

RewriteRule ^somepage$ someotherpage

What am I doing wrong?

Thanks!

Curvins.com
03-02-2009, 03:19 PM
My understanding is that you appear to be wanting redirect instead of rewriteRule.

The ReWriteRules I've used refer internally as follows:

ReWriteRule ^/~coolname(/.*)?$ /home/username/public_html/$1

So instead of going to:
http://www.mysite.com/~ltodd

They can go to:
http://www.mysite.com/~djcool

If you want to have them hit a different website you would use a redirect:
Redirect /greatthings http://www.greatthings.com

HTH

-Chad