Jump to content

PHP & .htaccess


jonw118

Recommended Posts

So, I'm moving servers from my current VPS to a new one (with Verio).

 

Here's the problem.

 

I have a dynamic php script called content_info.php that pulls the values from the DB and applies it to a template (using Xtemplate) and creates a html page.

 

For this to work, it uses a .htaccess file.

 

When I moved this stuff over to the new server - my .htaccess is not working - thereby rendering the content pages useless. I need some serious help here as it's critical.

 

Here is the .htaccess file:

 

Options +FollowSymLinks
RewriteEngine on
#RewriteBase /
RewriteRule ^content/(.*)/(.*).html  content_info.php?id=$1

 

I'm not a pro at all when it comes to dealing with Apache and .htaccess files. Is there any reason it couldn't move from one server to the next? What could I do to get this work?

 

Any help would GREATLY appreciated.

Link to comment
Share on other sites

To test if your new server is reading your .htaccess file by adding an invalid command into the .htaccess file like so:

foobar #invalid command

Options +FollowSymLinks
RewriteEngine on
#RewriteBase /
RewriteRule ^content/(.*)/(.*).html  content_info.php?id=$1

Now go to your website, and you should get a 500 Internal Server Error message. If you do Apache is reading your .htaccess file and so the problem is your to do with your RewriteRule. Try removing the # from in front of the RewriteBase line

 

If you don't get any error after applying the invalid command then ask your host about using .htaccess file with your hosting account. Your host may not allow the use of .htaccess files.

 

EDIT: If you have access to the servers configuration file (httpd.conf) then set the AllowOverride directive to All . The AllowOverride directive must be set to All (or fileInfo) in order for .htaccess files to read during http requests.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.