SunQuest
           Search Engine Optimization
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignSearch Engine Optimization

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 March 21st, 2005, 07:14 PM
Filenetwork Filenetwork is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 188 Filenetwork User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 22 h 45 m 21 sec
Reputation Power: 6
mod rewrite help

Ok I admin, mod rewrite is very frustrating . So im giving in on trying, and seeking some help.

First are my questions.

1) If you wanted to turn mp3.php?q=Query&In=Insomething would you need to rename mp3.php to mp3, and use a force mimetype?
2) If you did the above could you just type domain.com/mp3/Query/Insomething, and it will work vice versa also?


Heres what ive tried so far.

Code:
<Files mp3>
	ForceType application/x-httpd-php
</Files>

RewriteEngine On

# A request for this.php?that=someargument
# will be redirected externally to this/someargument
RewriteCond %{QUERY_STRING} ^s=(.+)$
RewriteRule ^mp3\.php /mp3/%1? [R,L]

# A request for this/someargument will be redirected internally
# to this.php?rewrite=yes&that=someargument
# I had to add on the query string the parameter rewrite to avoid
# to create an infinite loop, but because the redirection is
# done internally the client (the browser) won't see it
RewriteRule ^mp3/([^/]+)/?$ /mp3.php?q=([^/]+)&in=([^/]+) [L]


But it doesn't fully work


Thanks.

Reply With Quote
  #2  
Old March 30th, 2005, 07:46 AM
xiochtl333 xiochtl333 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 6 xiochtl333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 57 m 38 sec
Reputation Power: 0
I'm not clear exactly what you are trying to do, but if you are trying to mod rewrite:

domain.com/mp3.php?q=Query&In=Insomething

to:

domain.com/mp3/Query/Insomething


In your .htaccess file try:

RewriteEngine on
RewriteBase /

RewriteRule mp3/([^.]+)/([^.]+)/ mp3.php?q=$1&In=$2

DirectoryIndex index.html index.php

errorDocument 404 /index.php




In your main page add:
<base href="http://www.domain.com">

eg:

<html>
<head>
<title>Page title</title>
<base href="http://www.domain.com">
</head>

...rest of code






Quote:
Originally Posted by Filenetwork
Ok I admin, mod rewrite is very frustrating . So im giving in on trying, and seeking some help.

First are my questions.

1) If you wanted to turn mp3.php?q=Query&In=Insomething would you need to rename mp3.php to mp3, and use a force mimetype?
2) If you did the above could you just type domain.com/mp3/Query/Insomething, and it will work vice versa also?


Heres what ive tried so far.

[coe]
<Files mp3>
ForceType application/x-httpd-php
</Files>

RewriteEngine On

# A request for this.php?that=someargument
# will be redirected externally to this/someargument
RewriteCond %{QUERY_STRING} ^s=(.+)$
RewriteRule ^mp3\.php /mp3/%1? [R,L]

# A request for this/someargument will be redirected internally
# to this.php?rewrite=yes&that=someargument
# I had to add on the query string the parameter rewrite to avoid
# to create an infinite loop, but because the redirection is
# done internally the client (the browser) won't see it
RewriteRule ^mp3/([^/]+)/?$ /mp3.php?q=([^/]+)&in=([^/]+) [L]
[/code]

But it doesn't fully work


Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignSearch Engine Optimization > mod rewrite help


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway