Forum Moderators: phranque

Message Too Old, No Replies

Rewrite not working in Root

Rewrite not working in Root - Word Press, CPanel

         

maskme

10:25 am on Jan 9, 2009 (gmt 0)

10+ Year Member



Dear Friends,

I've a very weird problem. I've installed word press in my hosting space. However the rewrite does not work in Root, whereas if I push the files to a any folder inside the root, the Rewrite works perfectly.

What is wrong and what do i need to do to make it work. I'm pasting the code that I'm using in the .htaccess file.

//Code 1 for Root, I'm amending it in the existing .htaccess file which the host provides

# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

AuthName sample.com
AuthUserFile /home/sample/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/sample/public_html/_vti_pvt/service.grp

=================================

//Code 2 for the folder I'm putting it in any folder

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /newfolder
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /newfolder/index.php [L]
</IfModule>

# END WordPress

=================================

Can anyone guide me, what the problem is.

I'm Using CPanel and it's hosted in
Apache/2.0.63 (Unix)
mod_ssl/2.0.63
OpenSSL/0.9.8b
mod_auth_passthrough/2.1
mod_bwlimited/1.4
FrontPage/5.0.2.2635
PHP/5.2.5

My Hosting Provide does not have any idea since it is working in another folder in the same root

Can anyone tell me where the problem is? :(

Thank You Very Much !

phranque

11:55 am on Jan 9, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the rewrite does not work in Root

how does that translate to a server response?
i'm just guessing here but you probably don't need those RewriteBase directives and it might actually be hurting you in the one case.
if i were you, instead of guessing i would look in the server log to see what the ultimate request and response was.

maskme

1:12 pm on Jan 9, 2009 (gmt 0)

10+ Year Member



Dear Phranque

This is what i see in the Error Logs:

//Error
[Fri Jan 09 04:05:19 2009] [alert] [client 195.229.236.217] /home/sample/public_html/.htaccess: RewriteBase: argument is not a valid URL

================

When I type the www.samplesite.com it shows blank page. The wordpress does not work in the root but works if i put it in a folder in a root. Though the control panel works of the Word Press from the root. Only the rewrite is causing the problem.

I'm not sure what is wrong.

Caterham

4:38 pm on Jan 9, 2009 (gmt 0)

10+ Year Member



That error is issued, if the first character is not a slash. Anyway, since you're using an URL-path in your substitution, the feature won't take effect at all, hence, it couldn't have caused your problem.

What do you mean with "not working"? A native HTTP 404 not found issued from apache if you request /does_not_exist? Wordpress operates on $_SERVER['REQUEST_URI']. It may be a good idea to check the functionality with redirects (R flag) and not with internal rewrites.

maskme

6:32 pm on Jan 9, 2009 (gmt 0)

10+ Year Member



Hi Caterham

It just shows a blank page that's it, which is index.php and does not hold anything which is fine as its word press engine which i guess does processing from wp-content/themes/default/index.php.

The thing is it shows the content of a blank page, but if I put all the files of word press in another folder (created in the root), it works fine and the clean urls and everything works fine including .htaccess.

So can anyone let me know what the problem is, is their a security issue in Root, which Im not aware and that i should enable it for word press.

Please let me know
Thanks

maskme

6:56 am on Jan 10, 2009 (gmt 0)

10+ Year Member



Dear All

I finally found the problem. I changed the name of the themes to some other name instead of having it the domain name.

Basically I had named my themes the exact name as domain name, so for e.g. my domain name is www.xyz.com, so i had named the theme folder as well "xyz".

Though it used to work perfectly fine in my localhost or if i had put it in a different folder under the root of my online host.

So I just renamed the folder to something other than the domain name, it worked fine.

I'm not sure why this happened, if some one can throw a light on this matter.

But anyways the matter is resolved and hope if someone is in the same situation can take benefit from this post.

Thank You to All