Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-25-2010, 10:46 PM   #1
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
htaccess mod_rewrite help needed.

Hi can someone help me with this rewrite below... Thanks in advance.

Currently all sub domains are rewrite User.cial.com -> www.cial.com/view/USER.html ... I want to change that removing the subdomain rewrite and have www.cial.com/User -> www.cial.com/view/USER.html

Code:
<IfModule mod_rewrite.c>
RewriteEngine On		
RewriteCond %{HTTP_HOST} ^(cial\.com)$ [NC] 
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
RewriteCond %{HTTP_HOST} !^(www\.)?cial\.com$ [NC] 
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.cial\.com$ [NC] 
RewriteRule ^(.*)$ http://www.cial.com/view/%2.html [R=301,L]
RewriteCond %{REQUEST_URI} !^ads/
RewriteCond %{REQUEST_URI} !^shop/
RewriteCond %{REQUEST_URI} !^swf/
RewriteCond %{REQUEST_URI} !^js/
RewriteCond %{REQUEST_URI} !^mm/
RewriteCond %{REQUEST_URI} !^files/
RewriteCond %{REQUEST_FILENAME}  !-d
RewriteCond %{REQUEST_FILENAME}  !-f
RewriteRule ^(.*) index.php [L]
</IfModule>
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-26-2010, 10:25 AM   #2
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
this is what i have so far, its not right but I think it would be something like this
Code:
RewriteCond %{HTTP_HOST} !^(www\.)?cial\.com/([^\.]+)$ [NC]
RewriteRule ^(.*)$ http://www.cial.com/view/%2.html [R=301,L]
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-26-2010, 10:28 AM   #3
fatfoo
ICQ:649699063
 
Industry Role:
Join Date: Mar 2003
Posts: 27,763
Good luck with finding help.
__________________
Send me an email: [email protected]
fatfoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-26-2010, 10:44 AM   #4
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
post on the modrewrite forum, richardk is a ninja when it comes to this stuff
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-26-2010, 01:35 PM   #5
LustyVixens
Registered User
 
LustyVixens's Avatar
 
Join Date: Feb 2010
Posts: 79
Are you sure you are rewriting? At the moment it seems more like a redirect (on your website). The problem with rewriting cial.com/User to cial.com/view/USER.html is that your website will need to know that cial.com/xxx is a user else accessing a regular page such as cial.com/support will try to redirect with a "member" of that username.

Instead I would rewrite matches to send the part after the / to a PHP file that will query the database to determine whether it is in fact a user and if so, redirect to the user profile.

I'm not really sure what your setup is so I don't want to post any code, but for sites I develop I usually send everything that is not a physical file or directory (indicated by !-f and !-d in the .htaccess) through my controller script, e.g.

Code:
RewriteEngine on

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

RewriteRule ^(.*)$ __controller.php?p=$1 [L,QSA]
LustyVixens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-26-2010, 04:40 PM   #6
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
ya you want to check if its not a file or a dir first
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.