subdomain issues

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

Okay, so I have quite an annoying issue and I have no idea on how to get this right. We are building a site for a local shopping centre. Unfortunately we had to use their designs so things are a bit more difficult than they should've been.

The design is way too small to fit my CMS in properly (it runs inline much like drupal), so I decided to put the cms on a sub-domain of the site, which at first worked perfectly.

Domain: http://www.hatfieldplaza.co.za
CMS: http://mall-admin.hatfieldplaza.co.za

Now for sending SMSs and emails we use third party software which requires the requests to come off a secure server (https://), so I set up ssl on the domain. The ssl however does not support the sub-domain so now I need to point to http://www.hatfieldplaza.co.za/mall-admin instead of http://mall-admin.hatfieldplaza.co.za. Now my problem comes in where the stylesheets' and redirects' "src" starts with a slash(/) so if the html looks for /styles/stylesheet.css it's now supposed to be looking for /mall-admin/styles/stylesheet.css.

If I can't find a way to tell the server to just start looking for files in /mall-admin instead of / then I'll have to go through a ton of code and replace all the slashes (/) with /mall-admin which is going to take damn long.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

I think something simple like this will work when placed in the mall-admin directory.
Code: [ Select ]
RewriteEngine on
RewriteRule ^(.*)$ /mall-admin/$1
  1. RewriteEngine on
  2. RewriteRule ^(.*)$ /mall-admin/$1
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

Then I get an internal server error.

Here is my full .htaccess in the mall-admin folder:

Code: [ Select ]
Options +FollowSymLinks
RewriteEngine on

#Exclude all the necessary files/folders
RewriteRule ^ckeditor/.*$ - [PT]
RewriteRule ^ckfinder/.*$ - [PT]
RewriteRule ^templates/.*$ - [PT]
RewriteRule ^styles/.*$ - [PT]
RewriteRule ^javascript/.*$ - [PT]
RewriteRule ^images/.*$ - [PT]
RewriteRule ^temp.php$ - [PT]
RewriteRule ^index.php$ - [PT]
RewriteRule ^update_browser.php$ - [PT]
RewriteRule ^create_image.php$ - [PT]
RewriteRule ^upload_image.php$ - [PT]
RewriteRule ^upload_image.php$ - [PT]
RewriteRule ^install.php$ - [PT]
RewriteRule ^url_not_allowed.php$ - [PT]
RewriteRule ^ajax/.*$ - [PT]
RewriteRule ^modules/(.*)/(.*)/include/.*$ - [PT]
RewriteRule ^modules/(.*)/(.*)/ajax/.*$ - [PT]

#RewriteRule ^(.*)$ /mall-admin/$1

#The following rule is where objects get viewed/updated.
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/([a-z0-9_]+)$ index.php?module=$1&action=$2&url=$3 [L,QSA]

#The following rule is used where objects get created
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)$ index.php?module=$1&action=$2 [L,QSA]

#The following rule is the 'do' page for when objects get created or updated.
RewriteRule ^([a-z0-9_]+)$ index.php?module=$1 [L,QSA]

#The following rule catches any uppercase letters in the url. (Not allowed).
RewriteRule ^([a-zA-Z0-9_/]+)$ url_not_allowed.php
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3. #Exclude all the necessary files/folders
  4. RewriteRule ^ckeditor/.*$ - [PT]
  5. RewriteRule ^ckfinder/.*$ - [PT]
  6. RewriteRule ^templates/.*$ - [PT]
  7. RewriteRule ^styles/.*$ - [PT]
  8. RewriteRule ^javascript/.*$ - [PT]
  9. RewriteRule ^images/.*$ - [PT]
  10. RewriteRule ^temp.php$ - [PT]
  11. RewriteRule ^index.php$ - [PT]
  12. RewriteRule ^update_browser.php$ - [PT]
  13. RewriteRule ^create_image.php$ - [PT]
  14. RewriteRule ^upload_image.php$ - [PT]
  15. RewriteRule ^upload_image.php$ - [PT]
  16. RewriteRule ^install.php$ - [PT]
  17. RewriteRule ^url_not_allowed.php$ - [PT]
  18. RewriteRule ^ajax/.*$ - [PT]
  19. RewriteRule ^modules/(.*)/(.*)/include/.*$ - [PT]
  20. RewriteRule ^modules/(.*)/(.*)/ajax/.*$ - [PT]
  21. #RewriteRule ^(.*)$ /mall-admin/$1
  22. #The following rule is where objects get viewed/updated.
  23. RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/([a-z0-9_]+)$ index.php?module=$1&action=$2&url=$3 [L,QSA]
  24. #The following rule is used where objects get created
  25. RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)$ index.php?module=$1&action=$2 [L,QSA]
  26. #The following rule is the 'do' page for when objects get created or updated.
  27. RewriteRule ^([a-z0-9_]+)$ index.php?module=$1 [L,QSA]
  28. #The following rule catches any uppercase letters in the url. (Not allowed).
  29. RewriteRule ^([a-zA-Z0-9_/]+)$ url_not_allowed.php


I commented out the line you gave me because when I tried it I just received an "Internal Server Error" message.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 142 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.