The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> HTACCESS file merge, Need help merging two htaccess files
shondel
post Oct 10 2016, 12:53 PM
Post #1





Group: Members
Posts: 2
Joined: 10-October 16
Member No.: 24,881



I am developing a php website. I also have wordpress for blog and event calendar plugin capabilities. I recently moved the hatccess and index.php files for wordpress to the root directory so that the permalinks appear to come from the root. My problem is that the new website also has an index.php and htaccess file. I recently renamed the website to home.php and combined the htaccess files and added a DirectoryIndex line for both home.php and index.php. It works in Internet Explorer, but then when I reload a page on Firefox or Chrome, it gives a page not found.

Internet Explorer displays http://www.mydomain.com/#./page
Firefox and Chrome display http://www.mydomain.com/page

Wordpress HTACCESS(on the root):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
RewriteCond %{HTTP_HOST} ^dancetonightohio.com$
RewriteRule ^/?$ "http\:\/\/www\.dancetonightohio\.com\/" [R=301,L]

New website HTACCESS:
Options +FollowSymLinks +ExecCGI -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On

## uncomment the following line, if you are having trouble
## getting no_script_name to work
#RewriteBase /

## remove trailing slash
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(.+)/$
#RewriteRule ^(.+)/$ $1 [R=301,L]

## turn off index.html, it is for offline mode
RewriteRule ^.*index.html$ index.php [QSA]

## no, so we redirect to our front web controller
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

This is what I combined them as:
DirectoryIndex home.php index.php

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
#RewriteRule ^(.+)/$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^/?$ "http\:\/\/www\.mydomain\.com\/" [R=301,L]
# END WordPress
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 13th November 2019 - 10:30 PM