Re: problems with rewrite rules for clean urls for Drupal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2007-08-24 at 11:02 -0500, Scott wrote:
> It seems like the clean urls will not work but what I would like to do
> is have www.pilotalk.com/drupal rewritten to www.pilotalk.com.  How
> would this be acomplished? 

Have you carefully thought that through?  Is the new URI going to be
able to do whatever the old one did?  For script-based functions, the
client accesses a certain URI to generate a certain result.  If you're
changing the URIs, you're going to change the condition.  Drupal,
itself, might expect and generate /drupal prefixed URIs.  But if it
doesn't need to work that way, then you can change things.

For a specific URI a simple approach is to use a single redirect rule.

e.g. Redirect permanent /drupal   http://www.pilotalk.com/

But if you were doing redirects where /drupal/variable-something needs
changing to /variable-something (where it's variable), then you'd
probably need to use a re-write rule with variables.  Being unfamiliar
with Drupal, I'd suspect something like the following might do the
trick.

RewriteCond %{HTTP_HOST} pilotalk\.com/drupal/$ [NC]
RewriteRule ^(.*)$ http://www.pilotalk.comz/$1 [R=301,L]

Or, perhaps just:  RedirectMatch ^/drupal/$ http://www.pilotalk.com/

You might want to look into "RewriteBase /drupal/" as well.

Info:  <http://httpd.apache.org/docs/2.2/misc/rewriteguide.html>

Though, if Drupal is going to be your entire root documents, you might
as well configure the server that way.  i.e. Have the default virtual
host for www.pilotalk.com aimed at the Drupal file location rather
than /var/www/html/.

But, I suspect that you're going to run into a problem that Drupal
expects to work from a Drupal sub-directory off the main domain, expects
URIs to be prefixed with Drupal, and generates new URIs with it.

-- 
[tim@bigblack ~]$ uname -ipr
2.6.22.1-41.fc7 i686 i386

Using FC 4, 5, 6 & 7, plus CentOS 5.  Today, it's FC7.

Don't send private replies to my address, the mailbox is ignored.
I read messages from the public lists.




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux