Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 03-26-2006, 08:45 AM   #1 (permalink)
Inactive
 
wongpk's Avatar
 
Join Date: 07-14-05
Posts: 68
iTrader: 0 / 0%
wongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the rough
.htaccess help

I have this URL:

http://www.mysite.com/index.php?user=one

How to use .htaccess to rewrite it to become:

http://www.mysite.com/one

Anyone can help?
wongpk is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-26-2006, 11:02 AM   #2 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,905
iTrader: 0 / 0%
kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
Code:
Options +FollowSymlinks RewriteEngine on RewriteRule ^([0-9]+)-([a-z]+) http://mysite.com/blog/index.php?user=$1-$2 [nc]
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-26-2006, 11:41 AM   #3 (permalink)
Inactive
 
wongpk's Avatar
 
Join Date: 07-14-05
Posts: 68
iTrader: 0 / 0%
wongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the rough
Thanks!
wongpk is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-26-2006, 01:00 PM   #4 (permalink)
Inactive
 
wongpk's Avatar
 
Join Date: 07-14-05
Posts: 68
iTrader: 0 / 0%
wongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the roughwongpk is a jewel in the rough
Hi there again... That rewrite works well... but then I have another question about it...

How can I disallow one folder to rewrite? Like...

Rewrite:
http://www.mysite.com/index.php?user=one

to

http://www.mysite.com/one

(Solved)

On the other hand...
Don't rewrite
http://www.mysite.com/me

to

http://www.mysite.com/me

cause it's a folder..??
wongpk is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-27-2006, 07:35 AM   #5 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,905
iTrader: 0 / 0%
kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
Code:
rewriteCond %{REQUEST_URI} !^/me
add that after RewriteEngine On
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-30-2006, 06:30 PM   #6 (permalink)
Inactive
 
Join Date: 03-30-06
Posts: 1
iTrader: 0 / 0%
Latest Blog:
None

GrandMan is liked by many
Sorry to hijack this thread, but my problem is very similar so I don't think it needs a new one.

My website is http://wiki.theskatepress.com/index.php/Main_Page

I would like that, and all the other pages on the wiki to be http://wiki.theskatepress.com/Main_Page

Could anyon help me out with the code I would need to put in my .htaccess. Also, would doing such a redirect add to my server load (alot)?
GrandMan is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-31-2006, 07:48 PM   #7 (permalink)
Inactive
 
Antonio's Avatar
 
Join Date: 12-04-05
Posts: 449
iTrader: 0 / 0%
Latest Blog:
None

Antonio is a glorious beacon of lightAntonio is a glorious beacon of lightAntonio is a glorious beacon of lightAntonio is a glorious beacon of lightAntonio is a glorious beacon of lightAntonio is a glorious beacon of lightAntonio is a glorious beacon of lightAntonio is a glorious beacon of lightAntonio is a glorious beacon of lightAntonio is a glorious beacon of lightAntonio is a glorious beacon of light
Send a message via ICQ to Antonio Send a message via MSN to Antonio
Quote:
Originally Posted by m3lt
Code:
rewriteCond %{REQUEST_URI} !^/me
add that after RewriteEngine On
It seems not works with my wordpress

//edit

Code:
RewriteCond %{REQUEST_URI} ^/filename/(.*)$ [OR] RewriteCond %{REQUEST_URI} ^/failed_auth.html$ RewriteRule ^.*$ - [L]
It works after I added thest codes to .htaccess

Last edited by Antonio : 03-31-2006 at 07:55 PM.
Antonio is offline  
Add Post to del.icio.us
Reply With Quote
Old 04-04-2006, 08:53 AM   #8 (permalink)
Inactive
 
Mrblogs's Avatar
 
Join Date: 03-29-06
Posts: 546
iTrader: 0 / 0%
Mrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really nice
Send a message via MSN to Mrblogs Send a message via Yahoo to Mrblogs
Code:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]
Basically will redirect it if the asked for address isnt a file (-f) or a directory (-d)
Mrblogs is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
htaccess & SSL Sketch Coding Forum 3 08-28-2006 04:12 AM
.htaccess sim Coding Forum 5 01-24-2005 03:54 PM
What can you do with .htaccess? Jason Web Design Lobby 4 12-03-2004 11:39 PM
.htaccess help Limit Coding Forum 1 08-07-2004 11:34 AM
.htaccess Pimpen 2010 Coding Forum 15 10-21-2003 02:39 PM


Sponsor Links
Webmaster Forum Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 03:39 AM.
© Copyright 2008 V7 Inc