Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-06-2012, 05:40 PM   PM User | #1
Kurisvo
New Coder

 
Join Date: Apr 2011
Posts: 59
Thanks: 8
Thanked 0 Times in 0 Posts
Kurisvo is an unknown quantity at this point
.htaccess adding in previous page to url

Yes, yet another .htaccess question. xD

My .htaccess file looks like this:

Code:
RewriteBase /

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^view/([^/]+)$ view.php?view=$1 [L]
So if I try to access mysite.com/view/article, it works perfectly! The only problem I'm having is if there is a link on that page that is like /page.php it takes me to the URL of mysite.com/view/page.php

Is there a rule I'm missing in my .htaccess that will point all /page requests to the base? I'd like the url to be mysite.com/page.php instead of mysite.com/view/page.php.

I hope I was clear, I'm not the best at explaining these things!
Kurisvo is offline   Reply With Quote
Old 07-06-2012, 05:57 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I can't simulate this problem. Are you sure your link points to /page.php and not to page.php? If its missing the /, it will go from the directory in question according to HTML.
If its missing the /, and you want it to go from root, add the <base> tag into the html head.
Fou-Lu is offline   Reply With Quote
Old 07-06-2012, 06:40 PM   PM User | #3
Kurisvo
New Coder

 
Join Date: Apr 2011
Posts: 59
Thanks: 8
Thanked 0 Times in 0 Posts
Kurisvo is an unknown quantity at this point
Oh, good catch! I feel so stupid now. Thanks so much!
Kurisvo is offline   Reply With Quote
Old 07-12-2012, 05:35 PM   PM User | #4
Kurisvo
New Coder

 
Join Date: Apr 2011
Posts: 59
Thanks: 8
Thanked 0 Times in 0 Posts
Kurisvo is an unknown quantity at this point
Quick question.

I'm using the same .htaccess files and I have a page where I'm tracking the IP when people visit a certain page. I've noticed that every time I access a page it inserts both my IP and a different IP. I was wondering if this is something the .htaccess file could be doing because that's the only thing I can think of?
Kurisvo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:24 AM.


Advertisement
Log in to turn off these ads.