Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

Redirection

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


alberto at ipimtzcm

Jul 19, 2008, 11:32 AM

Post #1 of 2 (214 views)
Permalink
Redirection

I have this URL

http://www.server.com/index.php?article1.html

and work like that

http://www.server.com/?article1.html

But I really really need this

http://www.server.com/article1.html

And I need to work like previous URL and I need to make the changes in
.htaccess file

PLEASE I had try everything and nothing work, somebody can help me please.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


solprovider at apache

Jul 19, 2008, 8:50 PM

Post #2 of 2 (200 views)
Permalink
Re: Redirection [In reply to]

On 7/19/08, Alberto García Gómez <alberto [at] ipimtzcm> wrote:
> I have this URL
> http://www.server.com/index.php?article1.html
>
> and work like that
> http://www.server.com/?article1.html
>
> But I really really need this
> http://www.server.com/article1.html
>
> And I need to work like previous URL and I need to make the changes in
> .htaccess file
> PLEASE I had try everything and nothing work, somebody can help me please.

Am I missing something? The answer is your title. Just use
mod_rewrite to translate the old URLs to the new URLS or vice versa.

# Required for Rewrite
Options FollowSymLinks
RewriteEngine On
# Choose one or create potential infinite loop.
# Translate /article1.html -> /index.html?article1.html
RewriteRule ^/article1.html$ /index.html?article1.html [P]
# OR
# Translate ?article1.html -> /article1.html
RewriteCond %{QUERY_STRING} ^article1.html$
RewriteRule ^*$ /article1.html [P]

You could use [L] instead of [P] if you are certian that no proxy is
needed to find the file.

HTH,
solprovider

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.