Forum Moderators: phranque

Message Too Old, No Replies

Need to rewrite some urls

need some rewrite rules

         

ivanvias

4:40 am on Mar 25, 2014 (gmt 0)

10+ Year Member



Hi,

I am using unique subdomains and been getting some 404 errors on my site. Eg the following causes a 404 error.


http://subdomain.example.com/component/user/reset


I would like some rules to re-write these type of urls to these:

http://example.com/component/user/reset

IE to remove the subdomain

[edited by: phranque at 7:42 am (utc) on Mar 25, 2014]
[edit reason] Please Use example.com [webmasterworld.com] [/edit]

lucy24

6:48 am on Mar 25, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Rewrite (via proxy, I guess) or redirect?

Does the subdomain still exist? That is, it's obviously still got a DNS record, but does it still have content?

phranque

7:45 am on Mar 25, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



how many subdomains are you using and how do you identify which resources are served from which subdomain?

ivanvias

2:53 pm on Mar 25, 2014 (gmt 0)

10+ Year Member



I am using multiple subdomains.

I just want to be able to detect once there is a subdomain with /component/user/reset to rewrite this to

http://example.com/component/user/reset

phranque

3:20 pm on Mar 25, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



what have you tried?

lucy24

8:42 pm on Mar 25, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Same question again, then. Do you mean rewrite or redirect? What do you want the user's address bar to say?

ivanvias

8:48 pm on Mar 25, 2014 (gmt 0)

10+ Year Member



I want a rewrite. it should say http://example.com/component/user/reset

lucy24

3:00 am on Mar 26, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is perfectly OK to say that you're not clear on the difference between "rewrite" and "redirect". But if you say emphatically "rewrite" and then show an example illustrating "redirect" we can't get far :(

ivanvias

7:01 am on Mar 26, 2014 (gmt 0)

10+ Year Member



Okay, I guess i mean its a redirect. Can anyone assist ith the rules. If i type in the broser http://anysubdomain.example.com/component/user/reset i ant it to redirect to http://example.com/component/user/reset

[edited by: phranque at 8:35 am (utc) on Mar 26, 2014]
[edit reason] Please Use example.com [webmasterworld.com] [/edit]

lucy24

7:55 pm on Mar 26, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As phranque said above: What have you tried so far?

There exist forums that will simply take a question and spit out an answer. But this one has more of a teach-a-man-to-fish orientation. Otherwise you'll be back next month with a nearly identical question.

:: vague mental association with punchline of generic mathematician joke ::

ivanvias

8:07 pm on Mar 26, 2014 (gmt 0)

10+ Year Member



I havent tried. I had a couple of rules from this site years ago for my site now that i updated i got these type of urls in google.