homepage Welcome to WebmasterWorld Guest from 54.145.172.149
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
everything after some weird text, send to homepage
everything after some weird text, send to homepage
getoffmyisland



 
Msg#: 4155928 posted 10:24 am on Jun 21, 2010 (gmt 0)

Hey, i cant seem to find this problem on ur site.

i need to redirect 100s of conditions like this to the homepage:

http://example.com/example.com?querystring1=this&querystring2=that

..so everything after, and including, example.com?, must go to homepage, http://example.com/

i also have this similar problem, redirecting http://example.com/index.php/keyword1/example.html to hompage.
problem is again, i need to redirect 100's such URLs, EVERYTHING (including querystrings) after http://example.com/index.php/

pls help or direct me to a post with the solution.

 

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4155928 posted 1:46 pm on Jun 21, 2010 (gmt 0)

The 'template' for a single-line-solution mod_rewrite rule would be:

RewriteRule ^old-URL-path$ http://example.com/new-URL-path? [R=301,L]

The old-URL-path pattern in this case is "example\.com", the new-URL-path is blank, and the trailing question mark clears the current query string.

RewriteRule ^example\.com$ http://example.com/? [R=301,L]

See the resources cited in our Apache Forum Charter for more information.

Jim

getoffmyisland



 
Msg#: 4155928 posted 3:00 pm on Jun 21, 2010 (gmt 0)

the above didn't work for some reason

I want to redirect 100+ urls like this:

http://www.example.co.za/index.php/component/option,com_mailto/link,aHR0cDovL3d3dy5vbmVzb2xhci5jby56YS9pbmRleC5waHAvY29udGFjdC11cy5odG1s/tmpl,component/

.. to the homepage http://example.co.za/

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4155928 posted 3:14 pm on Jun 21, 2010 (gmt 0)

That is not at all what you asked for initially.

Adapt the 'template' in my first post to do what you want.

Jijm

getoffmyisland



 
Msg#: 4155928 posted 7:20 am on Jun 22, 2010 (gmt 0)

sorry for misunderstanding, i'm having trouble explaining what i want..

I want to the redirect everything, after the /index.php/ part to redirect to the homepage (as i tried to explain in the 1st post).

Is this possible with a simple rule, or must i redirect every url with a seperate rule ?

getoffmyisland



 
Msg#: 4155928 posted 1:20 pm on Jun 22, 2010 (gmt 0)

with everything i mean, everything that will ever be entered after the /index.php/ part by a user.

Is this possible ?

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4155928 posted 1:21 pm on Jun 22, 2010 (gmt 0)

Everything after

Is this a URL path, a filename, query string data, or any combination of those things?

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4155928 posted 3:16 pm on Jun 22, 2010 (gmt 0)


RewriteRule ^index\.php/ http://example.com/? [R=301,L]

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved