Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 09-11-2006, 09:55 PM
derivatives_programmer derivatives_programmer is offline
Hatchling Croc
 
Join Date: Sep 2006
Posts: 2
Question Can't make mod_rewrite/htaccess work

I am migrating a Wordpress blog from Dreamhost where it used rewrite rules for permalinks. I copied .htaccess file to /public_html/.htaccess but it doesn't seem to have any effect - the error log shows the original paths like
File does not exist: /home/username/public_html/wp/contact/

The beginning of .htaccess file is below. Do you I need
to enable something before the rewrite takes effect?

# BEGIN WordPress

RewriteEngine On
RewriteBase /wp/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [S=95]
RewriteRule ^(contact)/trackback/?$ /wp/index.php?pagename=$1&tb=1 [QSA,L]
RewriteRule ^(contact)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(contact)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(contact)/page/?([0-9]{1,})/?$ /wp/index.php?pagename=$1&paged=$2 [QSA,L]
RewriteRule ^(contact)/?([0-9]+)?/?$ /wp/index.php?pagename=$1&page=$2 [QSA,L]
Reply With Quote
  #2  
Old 09-12-2006, 07:37 AM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,067
Default Re: Can't make mod_rewrite/htaccess work

Check to see if you are running PHPSuExec. If so, try moving the mod_rewrite .htaccess above /public_html/.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #3  
Old 09-13-2006, 09:45 AM
derivatives_programmer derivatives_programmer is offline
Hatchling Croc
 
Join Date: Sep 2006
Posts: 2
Default Re: Can't make mod_rewrite/htaccess work

Serra,

I've looked around the cpanel and docs but I can't see how I can check if I am running PHPSuExec (some official post from 2005 said that all hostgator hosts were switching to PHPSuExec).

Also, could you elaborate why PHPSuExec should have any effect on the Apache rewrite rules?

Lastly, if I move .htaccess above /public_html/, wouldn't it conflict with Wordpress trying to maintain the rewrite rules in the web root?

Thanks in advance.
Reply With Quote
  #4  
Old 09-13-2006, 03:06 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,067
Default Re: Can't make mod_rewrite/htaccess work

Check PHPinfo. If server API is CGI you are running PHPSuExec.

Quote:
Originally Posted by derivatives_programmer View Post
wouldn't it conflict with Wordpress trying to maintain the rewrite rules in the web root?
What? I'm not sure of the question, but rewrite rules above the root will effect web root. I've had trouble getting rules to work if they were in the root, when I moved them above root they worked fine.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 03:48 PM.

 
Forum SEO by Zoints