Jump to content

Recommended Posts

I contacted my host but maybe i can get a quicker response on here who knows. This works locally on my personal server but does not work right on my host maybe one of you knows why this is

 

########## NO INDEX VIEWS ALLOWED
Options -Indexes
Options +FollowSymLinks
########## DENY ACCESS TO .HTACCESS
<Files ".ht*">
Deny From All
</Files>
#ErrorDocument 404 /notfound/
########## REWRITE ENGINE ON
RewriteEngine on
RewriteBase /
########## REDIRECT TO MYDOMAIN.COM
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^mydomain\.com [NC]
RewriteRule (.*) http://mydomain.com/$1 [R=301,L]
########## IGNORE DIRECTORIES
RewriteRule ^images(/.*)?$ - [L]
RewriteRule ^css(/.*)?$ - [L]
########## REDIRECT FILES TO INDEX.PHP
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php [R=301,L]

 

 

When I go to my site mydomain.com/ my PHP script then explodes the '/' value into an array. For some reason when I put the .htaccess file on my host it doesn't work properly because it is sending me to mydomain.com/index.php in the URL itself (it does not do this on my local machine) instead of just leaving it as is so in turn I get an error not found (index.php) because it is not in my scripts array.

 

Any help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/101028-solved-works-locally-but-not-on-host/
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.