You are viewing our Forum Archives. To view or take place in current topics click here.
htaccess help with addon domain
Posted:

htaccess help with addon domainPosted:

-Deano
  • Rated Awesome
Status: Offline
Joined: Aug 19, 201014Year Member
Posts: 5,243
Reputation Power: 532
Status: Offline
Joined: Aug 19, 201014Year Member
Posts: 5,243
Reputation Power: 532
Trying to get some redirect stuff done for a website.

Currently, I have the following rule in my htaccess:

RewriteCond %{HTTP_HOST} ^addondomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.addondomain.com/$1 [L,R=301]


This makes it so that if I typed in domain.com/anything , I would be redirected to [ Register or Signin to view external links. ] .

I have an issue where, because this domain is an addon domain, it does not properly load my index.php for that addon domain.

For example.

[ Register or Signin to view external links. ] will show my addon domain's index.php page.
[ Register or Signin to view external links. ] => [ Register or Signin to view external links. ]
addondomain.com/page.php => [ Register or Signin to view external links. ]

But if I do just addondomain.com, it redirects to [ Register or Signin to view external links. ] for that addon domain and does not load the index.php file. I just get a 404 error saying that it can't find the page.


My directory:

/
  [Addondomain]
    [css]
      styles.css
    index.php
    page.php
  [public_html] (Standard domain)
    [css]
      styles.css
    index.php
    page2.php
  .htaccess

#2. Posted:
Cyimking
  • E3 2016
Status: Offline
Joined: May 02, 201212Year Member
Posts: 1,129
Reputation Power: 34
Status: Offline
Joined: May 02, 201212Year Member
Posts: 1,129
Reputation Power: 34
Try:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L,QSA]
#3. Posted:
-Deano
  • PC Master Race
Status: Offline
Joined: Aug 19, 201014Year Member
Posts: 5,243
Reputation Power: 532
Status: Offline
Joined: Aug 19, 201014Year Member
Posts: 5,243
Reputation Power: 532
Thanks for the reply.

The issue I have is that then redirects the url to www.domain.com/Subdirectory/ where the index.php is. It also breaks my relative links when doing this (Images are broken)

I want it to display as www.domain.com instead of this.

It would probably be easier to show you the example:

[ Register or Signin to view external links. ]
[ Register or Signin to view external links. ]
#4. Posted:
Cyimking
  • V5 Launch
Status: Offline
Joined: May 02, 201212Year Member
Posts: 1,129
Reputation Power: 34
Status: Offline
Joined: May 02, 201212Year Member
Posts: 1,129
Reputation Power: 34
What about this?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /home1/insidethebox/LookseaVR/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /home1/insidethebox/LookseaVR/index.php [L]
</IfModule>


If not, check your DNS.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.