Hello There, Guest!
View New Posts  |  View Today's Posts
htaccess problem

  • 0 Vote(s) - 0 Average


07-15-2013, 11:18 AM #1
Skittles
Junior Member
**
Posts: 4 Threads:1 Joined: Jun 2012 Reputation: 0

htaccess problem
Alright, so I'm trying to make an up or down checker which fully works, but the only thing stopping the website from working is the htaccess.

Here is my htaccess when I go to: mysite(.com)/google.com
Code:
array(1) { ["url"]=> string(8) "isup.php" } Site is down

but, when I change the url to: mysite(.com)/url/google.com and change my htaccess to:
Code:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^url/(.+)$ isup.php?url=$1

It works. Any type of help is greatly appreciated.
This post was last modified: 07-15-2013, 11:23 AM by Skittles.

07-15-2013, 12:38 PM #2
KoBE
¯\_(ツ)_/¯
******
Global Moderators
Posts: 4,862 Threads:494 Joined: Jun 2011 Reputation: 67

RE: htaccess problem
So, do you want it to work with your main site directory, or with the /url/ appended to it?

Try adding: RewriteBase / under RewriteEngine On
This post was last modified: 07-15-2013, 12:44 PM by KoBE.

07-15-2013, 03:57 PM #3
Skittles
Junior Member
**
Posts: 4 Threads:1 Joined: Jun 2012 Reputation: 0

RE: htaccess problem
I want it to be my main directory.

So it would be like MySite.com/YouTube.com instead of MySite.com/url/MySite.com

07-15-2013, 10:12 PM #4
KoBE
¯\_(ツ)_/¯
******
Global Moderators
Posts: 4,862 Threads:494 Joined: Jun 2011 Reputation: 67

RE: htaccess problem
Try this:

Code:
RewriteEngine On
RewriteRule ^(.+)$ isup.php?url=$1 [L]


If it doesn't work, try to empty your browser cache and try it again. I remember I had a problem with a redirect a while back and clearing my cache fixed it.

07-16-2013, 12:30 AM #5
Skittles
Junior Member
**
Posts: 4 Threads:1 Joined: Jun 2012 Reputation: 0

RE: htaccess problem
That did not work for me even after I cleared my cache, nor did it work for a friend.

07-16-2013, 03:30 PM #6
KoBE
¯\_(ツ)_/¯
******
Global Moderators
Posts: 4,862 Threads:494 Joined: Jun 2011 Reputation: 67

RE: htaccess problem
Is the site live? If so, send me the link and I'll see it from a fresh cache.

07-17-2013, 12:09 AM #7
BreShiE
Knowledge Is Power
*****
Posts: 1,130 Threads:158 Joined: Sep 2011 Reputation: 12

RE: htaccess problem
Scratch this post.

Good luck finding your solution, Skittles.
This post was last modified: 07-17-2013, 12:09 AM by BreShiE.


"It was pretty impressive to watch a missile fly down an air vent, but couldn't we feasibly use that same technology to shoot food at hungry people?"

07-17-2013, 02:52 PM #8
Skittles
Junior Member
**
Posts: 4 Threads:1 Joined: Jun 2012 Reputation: 0

RE: htaccess problem
Sorry for the late reply.

As you can see:
upordown(.)pw/url/google.com works.

If I changed the htaccess to just / instead of url/ it wouldn't work.

09-09-2013, 08:02 PM #9
Spirit
One with Spirits
****
Posts: 572 Threads:66 Joined: Jun 2011 Reputation: 13

RE: htaccess problem
Well that is because you have defined an option to match for a string that starts with "url".

Code:
RewriteRule ^(.*)$ index.php?m=$1 [L,QSA]

The above line will take everything after the slash in your domain name, http://example.com/<this will be matched>
By using the regex you used, all you do is tell the server to send data to isup.php only if the string after your domain name starts with url.
If you try to line I posted above, this should solve the problem of having a address "http://example.com/url/google.com" instead of "http://example.com/google.com".

The problem with KoBE's line is that [L] ends the rewiriting process..

http://httpd.apache.org Wrote:last|L: Stop the rewriting process immediately and don't apply any more rules. Especially note caveats for per-directory and .htaccess context (see also the END flag)

Therefore you should apply, QSA, like [L,QSA], which appends the query string.

Quote:qsappend|QSA: Appends any query string from the original request URL to any query string created in the rewrite target.




Forum Jump:


Possibly Related Threads...
Thread Author Replies Views Last Post
  Website problem william7 2 2,102 12-23-2016, 04:59 AM
Last Post: Mazzn
  Javascript problem william7 4 3,939 03-01-2014, 07:21 PM
Last Post: AceInfinity
  CSS Overflow Problem BreShiE 16 5,787 02-26-2012, 03:49 AM
Last Post: BreShiE


Users browsing this thread: 1 Guest(s)