Help - Search - Members - Calendar
Full Version: htaccess Help
Hostony Board > General Support > General Support
Niakie
I am trying to do two things in one of my .htaccess files... I can do either sepratly, but they don't seem to want to work together...

I created a subdomain something like:

sub.mydomain.com

and what I want to do is first any calls to

www.mydomain.com/sub

I want redirected to sub/mydomain.com

and secondly I would like all calls under this to be handled by my index.php file (prefreably without it being seen as such. ie I would prefer the url to read sub.mydomain.com/ and not sub.mydomain.com/index.php)

Any ideas?
Stanly
Try to look here wink.gif
Niakie
That handles the redirection part, but not the override...

What I was trying to use was the Redirect command as well as the RewriteRule command.... basicly I want for example the url below:

sub.mydomain.com/test/file.ext (as seen in the browser)

to be handled by the file

sub.mydomain.com/index.php (not seen)

I have used the redirect and it works, and I used a forcetype in another area, but that won't work in this instance because it shows the file being used.
Alexandre
Please look at this link http://www.client-success.com/html/htaccess.php
Niakie
That actually has less information then the URL Stanly suggested... (although I have bookmarked both for future refference lol)

Here is what I am useing now:

CODE
Redirect /sub http://sub.mydomain.com

RewriteEngine on
RewriteBase /
RewriteRule ^/(\.*)$ index.php


The redirection works without a problem. The problem comes in useing the Rewrite commands... For example if I goto http://sub.mydomain.com/test I get a 404 error message, but what should happen is it shows the content of the index.php file... I have tried a number of customizations to the rewrite commands and nothing seems to be working...
Alexandre
You can find out more about rewrite by the following link:
http://httpd.apache.org/docs/misc/rewriteguide.html
Niakie
I was able to resolve this issue useing teh following code if anyone else has a problem simmilar to mine:

CODE
Redirect permanent /my/ http://my.mysite.com
Redirect permanent /my http://my.mysite.com

RewriteEngine On

Options +FollowSymlinks
RewriteBase /
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteRule ^([a-z]+)$ /index.php [nocase,last]
phobos
You can also create .htaccess file under subdomain directory that does not contain any files except request handler script.

With following content :
CODE
ErrorDocument 404 http://sub.domain.com/request_handler.php


All requests to none-existent files will be redirected to handler.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here