homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
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

 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:


..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.



 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.



 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:


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


 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.



 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 ?


 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 ?


 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?


 3:16 pm on Jun 22, 2010 (gmt 0)

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


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