Jump to content

Getting 403 after enabling Rewrite URLs

Featured Replies

Posted

When I go into System->Search Engine Optimization in AdminCP and enable Rewrite Urls I get 403 HTTP errors after uploading the .htaccess file I am told to upload.

This is on a test server, no real domain has been setup yet. So the sitename I use is something like: http://135.78.214.67/testsite.com

And the content of .htaccess that I downloaded from ACP and uploaded to server rooth looks like this:

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /testsite.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) /testsite.com/404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /testsite.com/index.php [L]
</IfModule>

testsite.com is just a folder on that server and this is the location where IPS is installed.

What could be wrong?

Get rid of the reference to testsite.com from your htaccess. 

  • Author

I have already tried that it still gives me 403 when I upload .htaccess with the following

 

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) /404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

Do you have mod_rewrite enabled on your test server?

  • Author

Yes mod_rewrite is enabled. Tested it with the following php script:

 

<?php
 if(!function_exists('apache_get_modules') ){ phpinfo(); exit; }
 $res = 'Module Unavailable';
 if(in_array('mod_rewrite',apache_get_modules())) 
 $res = 'Module Available';
?>
<html>
<head>
<title>A mod_rewrite availability check !</title></head>
<body>
<p><?php echo apache_get_version(),"</p><p>mod_rewrite $res"; ?></p>
</body>
</html>

Wich returned: Module Available...  so this should be working.

Can you let me know what your server software specs are?

  • Author

Yes.

SunOS
PHP version: 5.6.6
Mysql version 5.6.22
Apache/2.4.10

Can you confirm that  AllowOverride is enabled in httpd.conf

  • Author

I had to do a little research to find that information and what it is, I found the following in a httpd.conf file on the server:

<Directory />
    AllowOverride none
    Require all denied
</Directory>

So that that could be the problem. I dont want to mess with serverfiles I Dont know about, so I will have to check with my host tommorow.

 

Thank you very much for your help :thumbsup:

  • 6 months later...

I had the same issue, had to replace 

Options -MultiViews

with

Options +FollowSymlinks -MultiViews -Indexes

 

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.