Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 20th, 2012, 09:12 AM
scottcabal scottcabal is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 1 scottcabal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 27 sec
Reputation Power: 0
Htaccess / rewriterule problems on my site - any ideas?

I've spent the last 24 hours looking for solutions to my problem both here and by searching google but I've been unable to find anything. Sorry if this is duplicated anywhere however.

For the last version of my site, written in php, I just had one index page which I used requests like this to grab the correct page: I'm now writing the new version of the site, also in php, and I'm trying to make it have search engine friendly urls / slugs for example

/page/view/thispage
/account/login

I've managed to get it so that virtual subdomains work for each client, using the top portion of the code below, and I've managed to get the slug pages to work using the bottom portion.

The problem I'm having is with forms, such as the form to sign up for the site, edit a user profile etc. I've read on this site that with apache rewrites $_POST variables should be passed to the script, unlike with redirects, but I'm using rewrite and when any form data is passed to a slug (for example /profile/edit) it doesn't work, although if it's passed to virtualsubdomain.mydomain.com/test.php for example it does.

Can anybody help me out and find a way to fix the htaccess file below and allow $_POST vars to be passed to my slug script (index.php in the code below)? There's probably just a small thing I'm missing.

Code:
<IfModule mod_rewrite.c>RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mydomainhere.org
RewriteCond %{HTTP_HOST} ^(.+).mydomainhere.org/^(.+)
RewriteRule ^([^/]*)$ [mydomainhere.org...] [P,L]

ErrorDocument 404 /index.php

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php
</IfModule>

I can't work out why post vars can be read by php files that exist in the subdomains that are only virtual, but they can't be read when post them to a slug (such as /profile/editprofile). Global variables are off on my server but The following just brings up the default blanked variable so they obviously havent been passed.

PHP Code:
 $test ''//define the variable to please global vars off
$test $_POST["namehere"];
echo 
$test

I'm fairly new to using htaccess files for anything other than just including a custom error file as you can probably tell.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Htaccess / rewriterule problems on my site - any ideas?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap