![]() |
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:
|
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] |
Good luck with finding help.
|
post on the modrewrite forum, richardk is a ninja when it comes to this stuff
|
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 |
ya you want to check if its not a file or a dir first
|
All times are GMT -7. The time now is 06:16 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123