.htaccess redirect http://www.mypage.com/user/somedude example?
-
.htaccess redirect http://www.mypage.com/user/somedude example? Hello, I have the current .htaccess and I have a few issues: Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule .* - [L] RewriteRule ^(.*)$ http://www.mypage.com/home.php?u=$1/ [L,R=301] The problem is that if you type "www.mypage.com" in the url bar, it redirects you to: http://www.mypage.com/home.php?u=/ instead of http://www.mypage.com/index.php Also, I would like to add the /user/ dir to the url like this: http://www.mypage.com/user/someDude and it redirects you to http://www.mypage.com/home.php?u=someDude Finally, is there a problem if I change the (.*) to only numbers and alphabetic; (#[^a-z0-9]#i) something like that. If you can give the example will be really amazing. Note: the usernames only contain numbers and letters. Thanks, by the way, four days ago I had no idea .htaccess exist. =)
-
Answer:
"Thanks, by the way, four days ago I had no idea .htaccess exist. =)" ... and, for what I assume, you don't know much about programming the web either. In that case, STAY AWAY FROM .htaccess! Even well experienced programmers have problems with .htaccess. Reset or erase all contents of your .htaccess and start coding, properly, your index.php: THAT is where you should start. You will then use $_GET to grab the query string (the stuff after "?"), and, from there, redirect your user to whatever you want. You could also analyse the $_REQUEST variable to find out if the user has entered "something else".
Bona at Yahoo! Answers Visit the source
Other answers
"Thanks, by the way, four days ago I had no idea .htaccess exist. =)" ... and, for what I assume, you don't know much about programming the web either. In that case, STAY AWAY FROM .htaccess! Even well experienced programmers have problems with .htaccess. Reset or erase all contents of your .htaccess and start coding, properly, your index.php: THAT is where you should start. You will then use $_GET to grab the query string (the stuff after "?"), and, from there, redirect your user to whatever you want. You could also analyse the $_REQUEST variable to find out if the user has entered "something else".
just "JR"
Related Q & A:
- Does anyone know if www.16income.com is real or a scam?Best solution by answers.yahoo.com
- Is it reliable to buy in www.consoleshop.com?Best solution by Ask.Metafilter.Com
- Is www.islandsurf.com a reliable site?Best solution by Yahoo! Answers
- Is www.simsimgate.com a trustworthy site to buy stuff from?Best solution by Yahoo! Answers
- Has anyone used www.ecseller.com?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.