Jump to content

Recommended Posts

Ok, so I have a catch-all subdomain setup. This points to /sub to be handled by the index php file there. In that file atm, all I currently do is print out "The subdomain you are currently using is:" then the subdomain, as a way to test.

 

I also have a .htaccess in my root, that contains this:

RewriteEngine on
RewriteBase / 
Options -MultiViews
RewriteRule ^([0-9a-zA-Z-]+)/?$ shortlink.php?short=$1 [L]

This rewrites anything on the domain to the shortlink file to be handled. Such as www.mydomain.com/MyLink

 

That works perfectly, but with that htaccess file, if i try to access a subdomain, it no longer prints out which subdomain i am on, instead it says:

Not Found

The requested URL /shortlink.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

I have been looking around everywhere on how to make a rewrite cond that will only run the rewrite rule if IT IS NOT on a subdomain, but i just cant find it anywhere! Can anybody give me a little help?

 

Link to comment
https://forums.phpfreaks.com/topic/155657-htaccess-problem/
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.