Cannot get RewriteRule to work, at all!

Cipherlad

Registered
Sep 12, 2011
3
0
51
cPanel Access Level
Website Owner
Specifying anything for RewriteRule does nothing. I understand mod_rewrite is supposed to be installed automatically (I'm using the latest version of cPanel). But nothing works. Creating a redirect 301 line in my .htaccess file is good, so I know it's processing the file, but if I put in the following:

RewriteRule ^/articles/([^/]+)/([^/]+)\.htm$ http://www.mydomain.com/articles/$1/ [NC,R=301,L]

...it seems as though it's ignored. Even the following is ignored:

RewriteRule ^/articles/gooseliver/page1\.htm$ http://www.mydomain.com/articles/gooseliver/ [NC,R=301,L]

No matter what I try, I get the "Page Not Found" error. (but, redirect 301 /articles/gooseliver/page1.htm http://www.mydomain.com/articles/gooseliver/ works).

Another post had mentioned checking the error log, but I don't know where that is.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
The error log would be at /usr/local/apache/logs/error_log for someone with root SSH access. If you only have account level access, you can try checking cPanel > Error Log area.
 

Cipherlad

Registered
Sep 12, 2011
3
0
51
cPanel Access Level
Website Owner
I'll be checking that this evening. In the meantime, do the RewriteRule examples look right? Am I doing anything wrong in the syntax? Is there anything about the placement in, or other statements I need to put in the .htaccess file, that I need to be aware of?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Rewrite rules not working are going to be based on the specific rewrite rules, so the issues aren't exactly the same other than that some rewrite rules aren't working. We do not know what rewrite rules were being used in that thread as they were not noted.

As for issuing commands, that individual has root access to run commands. Such commands cannot be run in cPanel and mod_rewrite is always available with cPanel, so that itself is not the issue.

Contacting your hosting provider would be the best way to have this investigated.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Have you contacted your host if you do not have root access? Have you checked the error logs? What have you done for troubleshooting purposes besides posting here? Thanks!